[rt2x00-users] [PATCHv2 6/6] rt2x00: Use an enum instead of u16 for the rate_mode TX descriptor field

Helmut Schaa helmut.schaa at googlemail.com
Thu Feb 24 20:54:55 EST 2011


Am Donnerstag, 24. Februar 2011 schrieb Ivo Van Doorn:
> Hi,
> 
> On Thu, Feb 24, 2011 at 10:10 AM, Helmut Schaa
> <helmut.schaa at googlemail.com> wrote:
> > Am Donnerstag, 24. Februar 2011 schrieb Johannes Stezenbach:
> >> 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).
> >
> > Ok, thanks for pointing this out.
> >
> > Ivo, if you're applying this could you please remove the misleading comment
> > "might allow the compiler to use a u8 for the rate_mode" from the commit log?
> 
> Sure no problem, the patch didn't apply cleanly anyway :P

Urgs, sorry bout that. Did the other patches apply cleanly?

Helmut




More information about the users mailing list