2003-02-04 10:48:49

by Ph. Marek

[permalink] [raw]
Subject: Re: [PATCHes available] printk() without KERN_ prefixes? (in 2.5.59) (again)

> > #ifdef LITTLE_ENDIAN
> > (wptr[(((win + 1)*4)^4)/4] != 0)) {
> > #else
> > (wptr[win + 1] != 0)) {
> > #endif /* LITTLE_ENDIAN */
> > (the braces { and } don't add up in the file).
>
> they do, but your script doesn't use c preprocessor with right flags,
> which it probably should.
>
> The two braces above should be counted as one depending on LITTLE_ENDIAN
> defined.
# wc change_printk.pl
141 268 2361 change_printk.pl
I don't use the preprocessor - after all, which -D should I give? all? none? a
part? So my script just reads the files.

I know that my script could parse the #if's also - but that's a lot of work
with little use.

How about that?

#if defined(FORCE_ERRORS)
if (0) {
#elif !DEBUG
if (kdebug) {
#endif
...
#if !DEBUG || defined(FORCE_ERRORS)
}
#endif
(seen in arch/ia64/sn/io/sn2/pcibr/pcibr_error.c: pcibr_pioerror() )

It's just too complex to look on the #if's and gives not enough advantages.


Regards,

Phil