linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: "Enrico Weigelt, metux IT consult" <info@metux.net>,
	Jonathan Cameron <jic23@kernel.org>
Cc: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
	"Andrew Jeffery" <andrew@aj.id.au>, "Alban Bedel" <albeu@free.fr>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Scott Branden" <sbranden@broadcom.com>,
	bcm-kernel-feedback-list <bcm-kernel-feedback-list@broadcom.com>,
	"Eugeniy Paltsev" <Eugeniy.Paltsev@synopsys.com>,
	"Hoan Tran" <hoan@os.amperecomputing.com>,
	"Serge Semin" <fancer.lancer@gmail.com>,
	orsonzhai@gmail.com, baolin.wang7@gmail.com,
	zhang.lyra@gmail.com, "Vladimir Zapolskiy" <vz@mleia.com>,
	"Marek Behún" <marek.behun@nic.cz>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Lee Jones" <lee.jones@linaro.org>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Sascha Hauer" <kernel@pengutronix.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	dl-linux-imx <linux-imx@nxp.com>,
	"Grygorii Strashko" <grygorii.strashko@ti.com>,
	"Santosh Shilimkar" <ssantosh@kernel.org>,
	"Kevin Hilman" <khilman@kernel.org>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	linux-pwm@vger.kernel.org,
	"Linux OMAP Mailing List" <linux-omap@vger.kernel.org>,
	linux-tegra@vger.kernel.org
Subject: Re: [PATCH] drivers: gpio: use of_match_ptr() and ACPI_PTR() macros
Date: Tue, 17 Nov 2020 18:49:57 +0200	[thread overview]
Message-ID: <CAHp75Vfgs=-_SZoxGf9T93sBdKb6ak_YUi8=WPPF3YeZUsxQcA@mail.gmail.com> (raw)
In-Reply-To: <CAHp75VfPio=TacTTrY=vZp8vZ7qst_7zWeXKDpYvJ6q7oh2Hdw@mail.gmail.com>

On Tue, Nov 17, 2020 at 6:45 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Tue, Nov 17, 2020 at 5:45 PM Enrico Weigelt, metux IT consult
> <info@metux.net> wrote:
> >
> > The of_match_ptr(foo) macro evaluates to foo, only if
> > CONFIG_OF is set, otherwise to NULL. Same does ACPI_PTR with
> > CONFIG_ACPI. That's very helpful for drivers that can be used
> > with or without oftree / acpi.
> >
> > Even though most of the drivers touched here probably don't
> > actually need that, it's also nice for consistency to make it
> > the de-facto standard and change all drivers to use the
> > of_match_ptr() and ACPI_PTR() macros.
> >
> > A nice side effect: in some situations, when compiled w/o
> > CONFIG_OF/CONFIG_ACPI, the corresponding match tables could
> > automatically become unreferenced and optimized-away by the
> > compiler, w/o explicitly cluttering the code w/ ifdef's.
>
> NAK.
>
> It prevents using DT-enabled drivers on ACPI based platforms.
>
> +Cc: Jonathan who had done the opposite in the entire IIO subsystem.

And a side note: use of_match_ptr() and ACPI_PTR() in 99% is a mistake.



-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2020-11-17 16:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-17 15:43 [PATCH] drivers: gpio: use of_match_ptr() and ACPI_PTR() macros Enrico Weigelt, metux IT consult
2020-11-17 15:54 ` Thierry Reding
2020-11-17 16:01   ` Lee Jones
2020-11-17 16:45 ` Andy Shevchenko
2020-11-17 16:49   ` Andy Shevchenko [this message]
2020-11-18  9:53   ` Uwe Kleine-König
2020-11-18  9:56     ` Andy Shevchenko
2020-11-18 10:01       ` Andy Shevchenko
2020-11-18 10:08         ` Lee Jones
2020-11-18 10:15           ` Andy Shevchenko
2020-11-27 12:45         ` Enrico Weigelt, metux IT consult
2020-11-17 18:27 ` kernel test robot
2020-11-17 19:30 ` kernel test robot

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='CAHp75Vfgs=-_SZoxGf9T93sBdKb6ak_YUi8=WPPF3YeZUsxQcA@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=Eugeniy.Paltsev@synopsys.com \
    --cc=albeu@free.fr \
    --cc=andrew@aj.id.au \
    --cc=baolin.wang7@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=f.fainelli@gmail.com \
    --cc=fancer.lancer@gmail.com \
    --cc=festevam@gmail.com \
    --cc=grygorii.strashko@ti.com \
    --cc=hoan@os.amperecomputing.com \
    --cc=info@metux.net \
    --cc=jic23@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=khilman@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=marek.behun@nic.cz \
    --cc=matthias.bgg@gmail.com \
    --cc=orsonzhai@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=s.hauer@pengutronix.de \
    --cc=sbranden@broadcom.com \
    --cc=shawnguo@kernel.org \
    --cc=ssantosh@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vz@mleia.com \
    --cc=zhang.lyra@gmail.com \
    /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).