lkml.org 
[lkml]   [2006]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch 2.6.18-git] SPI -- Freescale iMX SPI controller driver
Date
On Monday 02 October 2006 1:38 pm, Andrew Morton wrote:
> On Mon, 2 Oct 2006 13:10:14 -0700
> David Brownell <david-b@pacbell.net> wrote:
>
> > > > +/* Message state */
> > > > +#define START_STATE ((void*)0)
> > > > +#define RUNNING_STATE ((void*)1)
> > > > +#define DONE_STATE ((void*)2)
> > > > +#define ERROR_STATE ((void*)-1)
> > >
> > > !?!??!?!
> >
> > Now that you mention it ... let me second that comment!
>
> These are "better enums". The problem with C's enums is that it's possible
> to mix them with integers and the compiler just swallows it. With the
> above, you'll get a warning if you make that mistake.

I see.


> Do the enum-mismatch checking in sparse.

With __bitwise types and values, for example...

- Dave


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-10-02 23:13    [W:0.055 / U:0.736 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site