lkml.org 
[lkml]   [2005]   [Jul]   [7]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 7 Jul 2005 00:13:57 -0700 (PDT)
FromDmitry Torokhov <>
SubjectRe: Patch of a new driver for kernel 2.4.x that need review
Hi Pekka,

Pekka J Enberg <penberg@cs.helsinki.fi> wrote:
> Hi Dmitry, > > Mark Gross writes:> > > > +> > > > +/* 0 = Dynamic allocation of the major device number */
> > > > +#define TLCLK_MAJOR 252> > Pekka J Enberg <penberg@cs.helsinki.fi> wrote:
> > > Enums, please. > > > 
> 
> Dmitry Torokhov writes:
> > But not here - it is a single constant, not a value of a distinct type.
> 
> Fair enough, "static const int" would work here too. Defines should be 
> avoided because they allow you to override a value without ever noticing it.
> 

Would not this cause compiler to allocate memory for the constant?
I suppose if GCC is really good it could eliminate allocation since
nothing takes its address, but I am not sure.

With #define you can be sure that it is just a constant expression.

-- 
Dmitry
-
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: 2005-07-07 09:19    [from the cache]
©2003-2008