Linux IIO development
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: linux-iio <linux-iio@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH] iio:accel:dmard06: Optimize when CONFIG_OF isn't set
Date: Fri, 26 Aug 2022 12:46:03 +0200	[thread overview]
Message-ID: <20220826124603.4a28a154@endymion.delvare> (raw)
In-Reply-To: <CAHp75VeSgmO_=mXVR4uSpbQDO8MBGZu4O2vLEqunHYuoPfJbbQ@mail.gmail.com>

Hi Andy,

On Thu, 25 Aug 2022 23:12:43 +0300, Andy Shevchenko wrote:
> On Thu, Aug 25, 2022 at 3:54 PM Jean Delvare <jdelvare@suse.de> wrote:
> >
> > When CONFIG_OF isn't set, we can optimize out dmard06_of_match as it
> > will never be used.  
> 
> NACK. There is a magic PRP0001 for ACPI case.

OK, I wasn't aware of this. As of_match_device() is a stub when
CONFIG_OF isn't set, I thought the table could never be used. But now I
see that the acpi subsystem accesses the table directly, so you are
correct, the optimization I suggested is bogus.

Now I'm curious, is there a well-defined subset of device names that
can be found in an ACPI table? If not, does that mean that any driver
with an OF entry could match, therefore of_match_ptr() should be
removed from the kernel entirely?

Another possibility would be to stub out of_match_ptr() only if neither
CONFIG_OF nor CONFIG_ACPI is set. But I'm not sure that would be worth,
as I expected either to be set on almost all kernels in practice
(except on s390x, but you wouldn't build any of these drivers there
anyway).

-- 
Jean Delvare
SUSE L3 Support

  reply	other threads:[~2022-08-26 10:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25 12:40 [PATCH] iio:accel:dmard06: Optimize when CONFIG_OF isn't set Jean Delvare
2022-08-25 20:12 ` Andy Shevchenko
2022-08-26 10:46   ` Jean Delvare [this message]
2022-08-26 15:18     ` Andy Shevchenko
2022-08-26 16:06       ` Jean Delvare
2022-08-26 16:10         ` Andy Shevchenko
2022-08-28 16:41           ` Jonathan Cameron

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=20220826124603.4a28a154@endymion.delvare \
    --to=jdelvare@suse.de \
    --cc=andy.shevchenko@gmail.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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