[rt2x00-users] [PATCHv2 6/6] rt2x00: Use an enum instead of u16 for the rate_mode TX descriptor field
Johannes Stezenbach
js at sig21.net
Thu Feb 24 19:24:33 EST 2011
On Wed, Feb 23, 2011 at 11:46:43PM +0100, Helmut Schaa wrote:
> Am Mittwoch, 23. Februar 2011 schrieb Helmut Schaa:
> > Am Mittwoch, 23. Februar 2011 schrieb Johannes Stezenbach:
> > > On Wed, Feb 23, 2011 at 01:46:23PM +0100, Helmut Schaa wrote:
> > > > This makes the code less error-prone and might allow the compiler to use
> > > > a u8 for the rate_mode.
> > > ...
> > > > - u16 rate_mode;
> > > > + enum rate_modulation rate_mode;
> > >
> > > I think on most platforms an enum is the same size as an int.
> >
> > Unless you specify __attribute__ ((packed)) in the enum definition.
>
> JFI calling gcc with "-fshort-enums" will also make use of smaller
> types for enums.
This is not used on purpose because it creates binary compatibility
issues in userspace ABI (various drivers uses enum in ioctls).
Johannes
More information about the users
mailing list