netdev
[Top] [All Lists]

Re: [PATCH] PKT_SCHED: remove c99ism

To: Herbert Poetzl <herbert@xxxxxxxxxxxx>
Subject: Re: [PATCH] PKT_SCHED: remove c99ism
From: Thomas Graf <tgraf@xxxxxxx>
Date: Mon, 17 Jan 2005 12:56:37 +0100
Cc: Andrew Morton <akpm@xxxxxxxx>, davem@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20050117090912.GB30371@xxxxxxxxxxxxxxxxx>
References: <20050115144010.33182075.akpm@xxxxxxxx> <20050115232554.GS26856@xxxxxxxxxxxxxx> <20050115153202.2f7f81c6.akpm@xxxxxxxx> <20050115234056.GT26856@xxxxxxxxxxxxxx> <20050117090912.GB30371@xxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
* Herbert Poetzl <20050117090912.GB30371@xxxxxxxxxxxxxxxxx> 2005-01-17 10:09
> On Sun, Jan 16, 2005 at 12:40:56AM +0100, Thomas Graf wrote:
> > * Andrew Morton <20050115153202.2f7f81c6.akpm@xxxxxxxx> 2005-01-15 15:32
> > > An uglier but more efficient approach is to whack braces around the whole
> > > thing.
> > 
> > Fine with me as well. The code isn't used that often and not deep in the
> > calling stack which is why I preferred the cleaner way first.
> 
> hmm, please remind me why putting some
> 
> #ifdef CONFIG_NET_CLS_ACT
>       int err;
>       struct tc_action *act;
> #endif
> 
> at the _beginning_ of that procedure would
> be a bad choice?

I personally don't think it's a bad choice but the less ifdefs the
better. 2 out of 3 of my latest bugs were related to such ifdefs because
testing gets more error prone. Personally I think the cleanest way
would be to create inlined functions together with a nop macro but
it would hide the mutual exclusiveness of NET_CLS_ACT and NET_CLS_POLICE
in this case which is even worse.

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