[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 21:17:09 AEDT 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?
> 
> Oh this was patch 6... sorry, haven't tried that one yet.
> Patch 1 applied cleanly, but patch 2 failed. I hadn't spend any
> aditional time on it yet,
> to apply them manually. So I will do that later today (then I will
> also check if the other
> patches apply cleanly or not).

Hehe, ok, just drop me a note if anything goes wrong and I'll rebase my local
tree and respin all patches ... Not sure yet what went wrong ;)

Thanks,
Helmut




More information about the users mailing list