Re: [PATCH] ACPI: Use ACPI companion to match only the first physical device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 :-)
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux