lkml.org 
[lkml]   [2013]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/11] use ether_addr_equal_64bits
> > > > 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.

julia


\
 
 \ /
  Last update: 2013-12-31 08:21    [W:0.103 / U:3.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site