Return-path: Received: from s3.sipsolutions.net ([144.76.43.152]:42173 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752491AbaAFKSM (ORCPT ); Mon, 6 Jan 2014 05:18:12 -0500 Message-ID: <1389003467.5891.5.camel@jlt4.sipsolutions.net> (sfid-20140106_111830_516062_C92AF75D) Subject: Re: [PATCH 4/11] use ether_addr_equal_64bits From: Johannes Berg To: Julia Lawall Cc: Ben Greear , Joe Perches , Henrique de Moraes Holschuh , 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 Date: Mon, 06 Jan 2014 11:17:47 +0100 In-Reply-To: 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> <52C2E8BA.6000800@candelatech.com> <52C2F056.1020005@candelatech.com> <1388999147.5891.2.camel@jlt4.sipsolutions.net> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Mon, 2014-01-06 at 10:09 +0100, Julia Lawall wrote: > > BUILD_BUG_ON(sizeof(struct foo) - offsetof(struct foo, addr) < 8); > > > > with the user(s?) and that should catch the scenario I was worrying > > about? > > OK, thanks. That is what I had in mind. But I was hoping to be able to > put it with the structure. Right - you might be able to do that with BUILD_BUG_ON_ZERO() as you pointed out, I haven't looked at these macros in a while. > Perhaps there is a way to make a macro that > expands to a dummy function that contains the BUILD_BUG_ON? But I guess > that would waste space? > > I think that 8 should be 16? No, that should be ETH_ALEN+2 really, I guess - it's not taking into account the size of the address member itself at all. johannes