linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Christian Dietrich <christian.dietrich@informatik.uni-erlangen.de>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	vamos-dev@lists.cs.fau.de
Subject: Re: [PATCH] mtd: dc21285.c: remove double check of CONFIG_ARCH_NETWINDER
Date: Tue, 29 May 2012 11:19:20 +0100	[thread overview]
Message-ID: <1338286760.11518.162.camel@shinybook.infradead.org> (raw)
In-Reply-To: <20120529100646.GA23383@faui49q.informatik.uni-erlangen.de>

[-- Attachment #1: Type: text/plain, Size: 1016 bytes --]

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

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 6171 bytes --]

      reply	other threads:[~2012-05-29 10:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-25  8:28 [PATCH] mtd: dc21285.c: handle nw_gpio_lock correctly Christian Dietrich
2012-05-26 13:54 ` Artem Bityutskiy
2012-05-29 10:06 ` [PATCH] netwinder: nw_gpio_lock is a raw_spinlock_t Christian Dietrich
2012-05-29 10:11   ` David Woodhouse
2012-05-29 10:24     ` Artem Bityutskiy
2012-05-31 10:15     ` [PATCH] netwinder: encapsulate CPLD hardware locking and access Christian Dietrich
2012-05-31 12:31       ` David Woodhouse
2012-05-29 10:52   ` [PATCH] netwinder: nw_gpio_lock is a raw_spinlock_t David Woodhouse
2012-05-29 10:06 ` [PATCH] mtd: dc21285.c: remove double check of CONFIG_ARCH_NETWINDER Christian Dietrich
2012-05-29 10:19   ` David Woodhouse [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1338286760.11518.162.camel@shinybook.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=christian.dietrich@informatik.uni-erlangen.de \
    --cc=dbaryshkov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=vamos-dev@lists.cs.fau.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).