Re: Patch of a new driver for kernel 2.4.x that need review

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dmitry,
Pekka J Enberg <[email protected]> wrote:
> 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.

Dmitry Torokhov writes:
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.

Constant propagation pass will eliminate the allocation. I checked GCC 3.3.5 and does this with -O1. Pekka
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux