From: Shuah Khan <skhan@linuxfoundation.org>
To: David Gow <davidgow@google.com>, Brian Norris <briannorris@chromium.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Maxime Ripard <mripard@kernel.org>,
linux-acpi@vger.kernel.org, Rae Moar <rmoar@google.com>,
Rob Herring <robh@kernel.org>,
linux-kselftest@vger.kernel.org,
"Rafael J. Wysocki" <rafael@kernel.org>,
kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v3 1/3] drivers: base: Don't match devices with NULL of_node/fwnode/etc
Date: Fri, 20 Dec 2024 10:33:51 -0700 [thread overview]
Message-ID: <c8e232e9-78ff-4051-995b-41454f9c4b51@linuxfoundation.org> (raw)
In-Reply-To: <CABVgOSmZUETNa8OfqTvMuGg8Dim3UjLzvKdeJia6aCV7Ydgzdg@mail.gmail.com>
On 12/18/24 22:45, David Gow wrote:
> On Tue, 17 Dec 2024 at 04:12, Brian Norris <briannorris@chromium.org> wrote:
>>
>> of_find_device_by_node(), bus_find_device_by_of_node(),
>> bus_find_device_by_fwnode(), ..., all produce arbitrary results when
>> provided with a NULL of_node, fwnode, ACPI handle, etc. This is
>> counterintuitive, and the source of a few bugs, such as the one fixed by
>> commit 5c8418cf4025 ("PCI/pwrctrl: Unregister platform device only if
>> one actually exists").
>>
>> It's hard to imagine a good reason that these device_match_*() APIs
>> should return 'true' for a NULL argument. Augment these to return 0
>> (false).
>>
>> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
>> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>> Signed-off-by: Brian Norris <briannorris@chromium.org>
>> ---
>
> Seems sensible enough to me.
>
> Acked-by: David Gow <davidgow@google.com>
>
> I assume this series (including the KUnit test changes) will go in via Greg.
>
Works for me.
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
thanks,
-- Shuah
next prev parent reply other threads:[~2024-12-20 17:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-16 20:11 [PATCH v3 0/3] drivers: base: Don't match device with NULL of_node/fwnode/etc + tests Brian Norris
2024-12-16 20:11 ` [PATCH v3 1/3] drivers: base: Don't match devices with NULL of_node/fwnode/etc Brian Norris
2024-12-19 5:45 ` David Gow
2024-12-20 17:33 ` Shuah Khan [this message]
2024-12-20 17:44 ` Greg Kroah-Hartman
2024-12-16 20:11 ` [PATCH v3 2/3] drivers: base: test: Enable device model tests with KUNIT_ALL_TESTS Brian Norris
2024-12-17 7:41 ` Maxime Ripard
2024-12-19 5:45 ` David Gow
2024-12-16 20:11 ` [PATCH v3 3/3] drivers: base: test: Add ...find_device_by...(... NULL) tests Brian Norris
2024-12-19 5:45 ` David Gow
2024-12-20 17:34 ` Shuah Khan
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=c8e232e9-78ff-4051-995b-41454f9c4b51@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=briannorris@chromium.org \
--cc=davidgow@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=kunit-dev@googlegroups.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=rmoar@google.com \
--cc=robh@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