Re: [PATCHv3] net: Define enum for the bits used in features.
From: David Miller <davem@davemloft.net>
Date: 2011-06-04 20:34:44
From: David Miller <davem@davemloft.net>
Date: 2011-06-04 20:34:44
From: Mahesh Bandewar <redacted> Date: Wed, 25 May 2011 15:42:16 -0700
Little bit cleanup by defining enum for all bits used. Also use those enum values to redefine flags. Signed-off-by: Mahesh Bandewar <redacted> --- Changes since v2: (1) Removed the include which was part of the other patch (split mishap). (2) Changed the enums to add NETIF_F_ prefix.
I hate to be a pain after you've put so much work into these patches,
but I simply don't like this approach.
I think the abstracted interfaces should come first. You don't need to
change any of the NETIF_F_* defines in order to do that. You should only
need to add the netdev_{set,clear,test}_*() macros.
If you want you can make the "bit" argument be the flag name after the
NETIF_F_ prefix, so "netdev_test_active_feature(dev, SG)"
Then you convert every single access.
Then you make the flags type opaque, which should at that point be a
6 line change at best.
And then you can implement the flags however you want.