From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Lee Jones <lee.jones@linaro.org>,
Darren Hart <dvhart@linux.intel.com>,
Jarkko Nikula <jarkko.nikula@linux.intel.com>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ACPI: Use ACPI companion to match only the first physical device
Date: Fri, 24 Oct 2014 21:16:56 +0300 [thread overview]
Message-ID: <20141024181656.GU1484@lahna.fi.intel.com> (raw)
In-Reply-To: <6871118.LYO2moLKYB@vostro.rjw.lan>
On Fri, Oct 24, 2014 at 04:57:17PM +0200, Rafael J. Wysocki wrote:
> > I didn't consider that it is even possible but yes, in that case we
> > should not return true here.
>
> Well, that why did you check if the list is not empty at all? :-)
>
> It is possible if someone sets the ACPI companion before calling acpi_bind_one()
> (some pieces of code do that). It may not be relevant here, but it won't hurt
> to be on the safe side.
Agreed.
> > >
> > > > + mutex_lock(&adev->physical_node_lock);
> > > > + if (!list_empty(&adev->physical_node_list)) {
> > > > + const struct acpi_device_physical_node *node;
> > > > +
> > > > + node = list_first_entry(&adev->physical_node_list,
> > > > + struct acpi_device_physical_node, node);
> > > > + if (node->dev != dev)
> > > > + ret = false;
> > >
> > > And that may be simply
> > >
> > > ret = node->dev == dev;
> >
> > OK.
>
> So what about the following modified version?
Looks good to me, thanks :-)
prev parent reply other threads:[~2014-10-24 18:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1414141950-228930-1-git-send-email-mika.westerberg@linux.intel.com>
2014-10-24 10:08 ` [PATCH] ACPI: Use ACPI companion to match only the first physical device Jarkko Nikula
2014-10-24 13:55 ` Rafael J. Wysocki
2014-10-24 13:50 ` Mika Westerberg
2014-10-24 14:20 ` Rafael J. Wysocki
2014-10-24 14:10 ` Mika Westerberg
2014-10-24 14:57 ` Rafael J. Wysocki
2014-10-24 18:16 ` Mika Westerberg [this message]
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=20141024181656.GU1484@lahna.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=dvhart@linux.intel.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=lee.jones@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@rjwysocki.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