[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1338286760.11518.162.camel@shinybook.infradead.org>
Date: Tue, 29 May 2012 11:19:20 +0100
From: David Woodhouse <dwmw2@...radead.org>
To: Christian Dietrich <christian.dietrich@...ormatik.uni-erlangen.de>
Cc: Artem Bityutskiy <artem.bityutskiy@...ux.intel.com>,
Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
vamos-dev@...ts.cs.fau.de
Subject: Re: [PATCH] mtd: dc21285.c: remove double check of
CONFIG_ARCH_NETWINDER
On Tue, 2012-05-29 at 12:06 +0200, Christian Dietrich wrote:
> When CONFIG_ARCH_NETWINDER is unset nw_en_write is a NOP. But
> machine_is_netwinder() also checks for
> CONFIG_ARCH_NETWINDER. Therefore in the !netwinder case the
> preprocessed code is:
>
> if (0)
> do {} while(0);
It's not a double check. It's a compile time check for "do we even need
to build this code at all?", and a separate run time check for "do we
need to run this code now?".
Think about the case where CONFIG_ARCH_NETWINDER is set, but you aren't
actually running this kernel binary on a netwinder *today*.
Yes, we might not support multi-platform kernels on ARM yet, but we are
slowly getting there. This kind of change just makes that harder.
And even if the machine_is_netwinder() "function" is *currently* a macro
which is hard-coded to return one or zero, that just means that your
change achieves nothing in the compiler output. It'll be silently
optimised away, or not, as appropriate.
--
dwmw2
Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (6171 bytes)
Powered by blists - more mailing lists