tech-kern archive

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

Re: Newbie Kernel Programmer looking for first project.



In article 
<3dc350d00807031336r407f78fh54300193058c8442%mail.gmail.com@localhost>,
Michael Litchard <michael%schmong.org@localhost> wrote:
>Thanks for the help so far. Here is where I'm at.
>
>When I see a pattern like this:
>
>#idef DEBUG
>   printf("foo"...);
>#endif
>
>I replace those three line with
>   aprint_debug("foo...");
>
>the reasoning being that aprint_debug uses AB_DEBUG to govern behavior,
>and a new convention is replacing the old.
>
>But I'm starting to question this. I see more complex preprocessor commands,
>and now I wonder if I should just leave them alone. Could you give me some
>feedback?
>                          Michael Litchard

This is a bad thing in general because it always adds code to the kernel
and it also slows down execution, because it needs to compute the arguments,
and call the function. With the macro we get rid of the code. Perhaps it
is better to have an APRINT_DEBUG() varyadic macro.

christos



Home | Main Index | Thread Index | Old Index