Re: Debug messages with cx24110

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

 



Hello Helmut,

Helmut Auer wrote:
> Here is a patch against cx24110.c.
> Without this one the driver is flooding the kernel log if debug is not set to off.
> 
> --- v4l-dvb/linux/drivers/media/dvb/frontends/cx24110.c      2007-05-26 13:06:19.069094276 +0200
> +++ tmp/cx24110.c      2007-05-28 19:48:43.648017940 +0200
> @@ -45,7 +45,7 @@
>          u32 lastesn0;
>   };
> 
> -static int debug;
> +static int debug = 0;

this is the default for static variables. The whole kernel relies on the
fact, that they are initialized to zero. How can this change anything?
Are you using a broken compiler? Can you try another version?

Quoting from the dietlibc FAQ:

Q: I see lots of uninitialized variables, like "static int foo;".  What
gives?
A: "static" global variables are initialized to 0.  ANSI C guarantees that.
   Technically speaking, static variables go into the .bss ELF segment,
   while "static int foo=0" goes into .data.  Because .bss is zero
   filled by the OS, it does not need to be in the actual binary.  So it
   is in fact better to not initialize static variables if the desired
   initialization value is 0 anyway.  The same is true for pointers, by
   the way.  On all platforms supported by the diet libc, numeric zero
   is also the pointer value for NULL.  So not initializing a static
   pointer yields NULL.

Regards,
Andreas


_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux