From: Andy Shevchenko <andy@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Jean Delvare <jdelvare@suse.de>, Sean Young <sean@mess.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Thierry Reding <thierry.reding@gmail.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pwm@vger.kernel.org,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org
Subject: Re: [PATCH] media: rc: Drop obsolete dependencies on COMPILE_TEST
Date: Mon, 12 Dec 2022 11:24:04 +0200 [thread overview]
Message-ID: <Y5bzNH2tYeFUIGnI@smile.fi.intel.com> (raw)
In-Reply-To: <20221212075907.4iwjsib5nrk7eqr2@pengutronix.de>
On Mon, Dec 12, 2022 at 08:59:07AM +0100, Uwe Kleine-König wrote:
> On Sun, Dec 11, 2022 at 11:14:35PM +0100, Jean Delvare wrote:
> > On Sun, 11 Dec 2022 21:56:48 +0100, Uwe Kleine-König wrote:
> > > On Mon, Nov 21, 2022 at 05:09:11PM +0100, Jean Delvare wrote:
...
> > > > - .of_match_table = of_match_ptr(pwm_ir_of_match),
> > > > + .of_match_table = pwm_ir_of_match,
> > > That hunk makes sense even without the Kconfig change. ACPI makes use of
> > > .of_match_table, so
> > >
> > > .of_match_table = of_match_ptr(pwm_ir_of_match),
> > >
> > > is (almost?) always wrong.
> >
> > Should we just get rid of this macro altogether then?
> >
> > (Somehow I have a strange feeling that we already had this
> > discussion...)
>
> Might be. But for me this is only second hand knowledge, too. Maybe
> someone of the new recipents in this thread feels competent to comment
> here?!
Pros of of_match_ptr() / ACPI_PTR():
- saves a few dozens of bytes in the module ID tables
- doesn't show ACPI ID for non-ACPI platform or OF ID on non-OF platforms
Cons:
- prevents from using OF IDs on ACPI platforms
- doesn't show ACPI ID for non-ACPI platform or OF ID on non-OF platforms
- makes error prone for the compiler to have the variable unused
- makes code uglier
(I left the second in the both because I find useful to have all supported IDs
to be listed even if the system is compiled with OF/ACPI opted-out.)
Personally I remove the of_match_ptr()/ACPI_PTR() from drivers that can be used
on OF or ACPI platforms, which leaves us only with the drivers we are 100% sure
that they won't ever be used on non-OF platforms. BUT, I do not see any sense
to have of_match_ptr() that either in use, because the driver in question is
100% for OF platform, or not when it's compile tested, which means it reduces
test coverage anyway. All the same for ACPI_PTR().
TL;DR: I don't see any [big] usefulness of keeping those macros.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2022-12-12 9:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-21 16:09 [PATCH] media: rc: Drop obsolete dependencies on COMPILE_TEST Jean Delvare
2022-12-11 20:56 ` Uwe Kleine-König
2022-12-11 22:14 ` Jean Delvare
2022-12-12 7:59 ` Uwe Kleine-König
2022-12-12 9:24 ` Andy Shevchenko [this message]
2022-12-22 21:21 ` Uwe Kleine-König
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=Y5bzNH2tYeFUIGnI@smile.fi.intel.com \
--to=andy@kernel.org \
--cc=jdelvare@suse.de \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rafael@kernel.org \
--cc=sean@mess.org \
--cc=thierry.reding@gmail.com \
--cc=u.kleine-koenig@pengutronix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.