From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julia Lawall Date: Tue, 31 Dec 2013 06:32:46 +0000 Subject: Re: [PATCH 4/11] use ether_addr_equal_64bits Message-Id: List-Id: References: <1388427307-8691-1-git-send-email-Julia.Lawall@lip6.fr> <1388427307-8691-5-git-send-email-Julia.Lawall@lip6.fr> <1388429761.4410.1.camel@jlt4.sipsolutions.net> <1388438724.4573.2.camel@jlt4.sipsolutions.net> <20131230215701.GA4938@khazad-dum.debian.net> <1388445188.18164.0.camel@jlt4.sipsolutions.net> <1388445422.26796.38.camel@joe-AO722> In-Reply-To: <1388445422.26796.38.camel@joe-AO722> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Joe Perches Cc: Johannes Berg , Henrique de Moraes Holschuh , Julia Lawall , kernel-janitors@vger.kernel.org, Emmanuel Grumbach , Intel Linux Wireless , "John W. Linville" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org > > > > 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