public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Ben Greear <greearb-my8/4N5VtI7c+919tysfdA@public•gmane.org>
To: Julia Lawall <julia.lawall-L2FTfq7BK8M@public•gmane.org>,
	Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public•gmane.org>
Cc: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public•gmane.org>,
	Henrique de Moraes Holschuh
	<hmh-N3TV7GIv+o9fyO9Q7EP/yw@public•gmane.org>,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
	Emmanuel Grumbach
	<emmanuel.grumbach-ral2JQCrhuEAvxtiuMwx3w@public•gmane.org>,
	Intel Linux Wireless
	<ilw-VuQAYsv1563Yd54FQh9/CA@public•gmane.org>,
	"John W. Linville"
	<linville-2XuSBdqkA4R54TAoqtyWWQ@public•gmane.org>,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public•gmane.org
Subject: Re: [PATCH 4/11]  use ether_addr_equal_64bits
Date: Tue, 31 Dec 2013 07:54:34 -0800	[thread overview]
Message-ID: <52C2E8BA.6000800@candelatech.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1312310726540.1930-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>

On 12/30/2013 10:32 PM, Julia Lawall wrote:
>>>>> I'm just thinking of a programmer, e.g. changing a struct like this:
>>>>>
>>>>>   struct foo {
>>>>>     u8 addr[ETH_ALEN];
>>>>> -  u16 dummy;
>>>>>   };
>>
>> I don't know of a way to catch that.
>> Anyone else?
>
> Well, one could have a semantic patch that checks for that.  But the
> problem is that it is very slow, and it only covers the cases that I can
> transform automatically, which currently means no pointers, only explicit
> arrays.
>
> On the other hand, I am finding the structure definition, so I can easily
> update the structure definition with an appropriate comment.
>
> struct foo {
>      u8 addr[ETH_ALEN]; /* must be followed by two bytes in the structure */
>      u16 dummy;
> };
>
> Unfortunately it is kind of verbose.  Could there be an attribute?  That
> could even easily be checked.

Can you not just add a build-time macro to check that sizeof(foo) >= 8
for each of these struct foos?  Or, is it required that the dummy field
be there and be not used by anything else?

Thanks,
Ben

>
> julia
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public•gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


-- 
Ben Greear <greearb-my8/4N5VtI7c+919tysfdA@public•gmane.org>
Candela Technologies Inc  http://www.candelatech.com

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public•gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-12-31 15:54 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-30 18:14 [PATCH 0/11] use ether_addr_equal_64bits Julia Lawall
2013-12-30 18:14 ` [PATCH 1/11] rt2x00: " Julia Lawall
2013-12-31 16:44   ` Gertjan van Wingerde
2013-12-30 18:14 ` [PATCH 2/11] ath5k: " Julia Lawall
2013-12-30 18:14 ` [PATCH 3/11] mac80211: " Julia Lawall
2013-12-30 18:10   ` Christian Lamparter
2013-12-30 18:15 ` [PATCH 4/11] " Julia Lawall
2013-12-30 18:56   ` Johannes Berg
2013-12-30 19:58     ` Julia Lawall
2013-12-30 21:25       ` Johannes Berg
2013-12-30 21:57         ` Henrique de Moraes Holschuh
     [not found]           ` <20131230215701.GA4938-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
2013-12-30 23:13             ` Johannes Berg
2013-12-30 23:17               ` Joe Perches
2013-12-31  6:32                 ` Julia Lawall
     [not found]                   ` <alpine.DEB.2.02.1312310726540.1930-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
2013-12-31 15:54                     ` Ben Greear [this message]
2013-12-31 16:09                       ` Julia Lawall
2013-12-31 16:27                         ` Ben Greear
2013-12-31 16:40                           ` Julia Lawall
2014-01-06  9:05                             ` Johannes Berg
     [not found]                               ` <1388999147.5891.2.camel-8Nb76shvtaUJvtFkdXX2HixXY32XiHfO@public.gmane.org>
2014-01-06  9:09                                 ` Julia Lawall
2014-01-06 10:17                                   ` Johannes Berg
2014-01-06  8:48                 ` Julia Lawall
2014-01-06  8:59                   ` Joe Perches
2014-01-06  9:04                     ` Julia Lawall
2014-01-06  9:07                       ` Johannes Berg
2014-01-06  9:20                         ` Julia Lawall
2013-12-31  6:26               ` Emmanuel Grumbach
2014-01-06  9:24                 ` Geert Uytterhoeven
2014-01-06  9:35                   ` Julia Lawall
2014-01-06 15:18                   ` Eric Dumazet
2014-01-06 10:48               ` Dan Carpenter
2014-01-17 10:18                 ` Dan Carpenter
2013-12-30 18:15 ` [PATCH 5/11] mwl8k: " Julia Lawall
2013-12-30 18:15 ` [PATCH 6/11] rtlwifi: " Julia Lawall
2013-12-30 21:08   ` Larry Finger
2013-12-30 18:15 ` [PATCH 7/11] iwlegacy: " Julia Lawall
2013-12-30 18:15 ` [PATCH 8/11] " Julia Lawall
2013-12-30 18:15 ` [PATCH 9/11] ipw2x00: " Julia Lawall
2013-12-30 18:15 ` [PATCH 10/11] at76c50x-usb: " Julia Lawall
2013-12-30 18:15 ` [PATCH 11/11] carl9170: " Julia Lawall
2013-12-30 18:10   ` Christian Lamparter
2014-01-17 21:24 ` [PATCH 0/11] " Pavel Machek
2014-01-17 22:02   ` Oleksij Rempel
2014-01-17 22:43     ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52C2E8BA.6000800@candelatech.com \
    --to=greearb-my8/4n5vti7c+919tysfda@public$(echo .)gmane.org \
    --cc=emmanuel.grumbach-ral2JQCrhuEAvxtiuMwx3w@public$(echo .)gmane.org \
    --cc=hmh-N3TV7GIv+o9fyO9Q7EP/yw@public$(echo .)gmane.org \
    --cc=ilw-VuQAYsv1563Yd54FQh9/CA@public$(echo .)gmane.org \
    --cc=joe-6d6DIl74uiNBDgjK7y7TUQ@public$(echo .)gmane.org \
    --cc=johannes-cdvu00un1VgdHxzADdlk8Q@public$(echo .)gmane.org \
    --cc=julia.lawall-L2FTfq7BK8M@public$(echo .)gmane.org \
    --cc=kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    --cc=linville-2XuSBdqkA4R54TAoqtyWWQ@public$(echo .)gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox