[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1389003467.5891.5.camel@jlt4.sipsolutions.net>
Date: Mon, 06 Jan 2014 11:17:47 +0100
From: Johannes Berg <johannes@...solutions.net>
To: Julia Lawall <julia.lawall@...6.fr>
Cc: Ben Greear <greearb@...delatech.com>,
Joe Perches <joe@...ches.com>,
Henrique de Moraes Holschuh <hmh@....eng.br>,
kernel-janitors@...r.kernel.org,
Emmanuel Grumbach <emmanuel.grumbach@...el.com>,
Intel Linux Wireless <ilw@...ux.intel.com>,
"John W. Linville" <linville@...driver.com>,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/11] use ether_addr_equal_64bits
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists