[PATCH 3/3] bridge: Add support for VLANs

Thomas Haller thaller at redhat.com
Mon Dec 7 07:15:04 PST 2015


On Mon, 2015-12-07 at 08:01 -0700, David Ahern wrote:
> On 12/7/15 4:25 AM, Thomas Haller wrote:
> > > A couple of comments:
> > > 1. since you changed the bitmap from unsigned longs to uint32 the
> > > __builtin_ffsl should be changed to __builtin_ffs.
> > 
> > Changed. I think it is always true on supported archs that
> > sizeof(uint32_t) <= sizeof(int).
> 
> I thought 'int' was 4 bytes (or at least 4) on all modern processors.

Yes. I agree.




> > I am unsure what happens when casting the unsigned value to "signed
> > int", but I guess it will still work as expected/correctly.
> 
> I don't follow. The prototype is 'int __builtin_ffs (unsigned int x)'
> so 
> should not have unsigned/signed conversions.

I looked at https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
which says:

  Built-in Function: int __builtin_ffs (int x)

anyway, I think even casting to "signed int" it should work correctly.



Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20151207/b9d80a8c/attachment.sig>


More information about the libnl mailing list