linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Daniel Palmer <daniel@0x0f.com>
Cc: Paul Cercueil <paul@crapouillou.net>,
	Linus Walleij <linus.walleij@linaro.org>,
	od@zcrc.me,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	"open list:BROADCOM NVRAM DRIVER" <linux-mips@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] pinctrl: ingenic: Only support SoCs enabled in config
Date: Wed, 9 Dec 2020 12:04:53 +0100	[thread overview]
Message-ID: <CAK8P3a37rQz6ihEJBZNkOARJXJE7U9TX7pCUhyQjQn6fJw+jUQ@mail.gmail.com> (raw)
In-Reply-To: <CAFr9PX=EgQSXeATLn++DSHkkQar35rpLGh978J5Lnw9jS8XMrw@mail.gmail.com>

On Wed, Dec 9, 2020 at 11:13 AM Daniel Palmer <daniel@0x0f.com> wrote:
>
> Hi Paul and others,
>
> Sorry to hijack this but I actually want to do something similar to
> this in some other drivers.
> The targets I'm working with have only 64MB of ram so I want to remove
> code wherever possible.
> Is there any reason to do it like this instead of wrapping the whole
> unneeded of_device_id struct in an #ifdef?
> For example there is a rule that the compatible strings have to be
> present even if the driver isn't usable or something?

No, there is no such rule, but adding lots of #ifdef checks in this
file would be much less readable and more error-prone, as you'd
have to make sure the two #ifdef blocks around the structure
match the one for the ID table, and any function that is called
by more than one SoC has the correct combination of A || B || D
checks, and nobody ever gets that right.

      Arnd

  reply	other threads:[~2020-12-09 11:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-08 16:48 [PATCH 1/2] if_enabled.h: Add IF_ENABLED_OR_ELSE() and IF_ENABLED() macros Paul Cercueil
2020-12-08 16:48 ` [PATCH 2/2] pinctrl: ingenic: Only support SoCs enabled in config Paul Cercueil
2020-12-09 10:13   ` Daniel Palmer
2020-12-09 11:04     ` Arnd Bergmann [this message]
2020-12-08 17:39 ` [PATCH 1/2] if_enabled.h: Add IF_ENABLED_OR_ELSE() and IF_ENABLED() macros Randy Dunlap
2020-12-08 19:00   ` Paul Cercueil
2020-12-09  8:59 ` Linus Walleij
2020-12-09 11:31   ` Paul Cercueil
2020-12-09  9:38 ` Ard Biesheuvel
2020-12-09 11:27   ` Paul Cercueil

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=CAK8P3a37rQz6ihEJBZNkOARJXJE7U9TX7pCUhyQjQn6fJw+jUQ@mail.gmail.com \
    --to=arnd@kernel.org \
    --cc=daniel@0x0f.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=od@zcrc.me \
    --cc=paul@crapouillou.net \
    /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).