[Top] [All Lists]

Re: [PATCH] include/asm-mips/pci.h

To: William Jhun <>
Subject: Re: [PATCH] include/asm-mips/pci.h
From: Paul Jackson <>
Date: Wed, 19 Jun 2002 13:38:52 -0700 (PDT)
Cc: Ralf Baechle <>, <>
In-reply-to: <>
On Wed, 19 Jun 2002, William Jhun wrote:
> Note that without the #ifdefs, you may get warnings like:
> ../../../ayr/linux/include/asm/pci.h: In function `prep_buffer':
> ../../../ayr/linux/include/asm/pci.h:89: warning: statement with no effect
> ...
> So are we still sure we want to leave them out?

Yes - leave them out (speaking out of context here - hopefully still

Remove the warnings instead.

I've gotten in the habit of having the following form to
optional code logic:

In some header file foobar.h:

    #define init_foobar(x) do {         \
            int f = 2 * (x);            \
            foobar_initialize(f);       \
        | while (0)
    #define init_foobar(x) do {} while (0)

I don't see any warnings from this, and it provides just
the right sort of syntax wrapper on the macro init_foobar(),
forcing it to be a single statement, regardless of context,
while providing a nested block context for any local variables.

                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <> 1.650.933.1373

<Prev in Thread] Current Thread [Next in Thread>