lkml.org 
[lkml]   [2005]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [NET]: Shut up warnings in net/core/flow.c


On Wed, 23 Nov 2005, David S. Miller wrote:
>
> From: Andrew Morton <akpm@osdl.org>
> Date: Wed, 23 Nov 2005 00:21:34 -0800
>
> > Nope, this will break !CONFIG_SMP builds. Quite a few places in the
> > kernel do not implement the ipi handler if !CONFIG_SMP.
>
> Ho hum, nothing is ever easy eh? :-) I think your patch is fine for
> now, but in the long term the !CONFIG_SMP ifdefs for those ipi
> handlers should probably just get removed. If GCC can't optimize
> those things away, I'd be really surprised.

I just reverted the whole commit.

We've had this exact thing before, and it's easy enough to handle, but you
have to do it right.

The way to handle it is to do

static inline int maybe_ignored(int arg, ...)
{
return arg;
}

#define smp_call_function(func,info,retry,wait) \
maybe_ignored(0, info, retry, wait)

which is a very useful way to say: we don't care about "func", but we want
to avoid unused warnings for "info", "retry" and "wait", and we want to
return 0 regardless and compile it all away.

If somebody tests this, puts the "maybe_ignored()" function in some nice
generic header file, I'll apply it.

I _refuse_ to apply the patch from Andrew that adds "(void)" to shut up
the compiler. That's a piece of crap, and we should never do things like
that. Bad C style.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-11-18 23:46    [W:0.102 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site