Re: [RFC 1/2] i2c: Use stable dev_name for ACPI enumerated I2C slaves

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

 



On Friday, October 25, 2013 03:55:29 PM Jarkko Nikula wrote:
> Hi
> 
> On 10/25/2013 03:52 PM, Rafael J. Wysocki wrote:
> >   
> > +static void i2c_dev_set_name(struct i2c_adapter *adap,
> > +			     struct i2c_client *client)
> > +{
> > +#if IS_ENABLED(CONFIG_ACPI)
> > +	if (ACPI_HANDLE(&client->dev)) {
> > ACPI_HANDLE() already contains an "is CONFIG_ACPI enabled?" check, so the #if
> > around the if (ACPI_HANDLE()) {} is redundant.
> >
> > Similarly for the SPI patch.
> >
> Well, acpi_bus_get_device() is not available for non-ACPI builds and at 
> least the gcc I used for test build didn't optimize that block away.

Well, it should.  ACPI_HANDLE() translates to (NULL) if CONFIG_ACPI
is not defined and that causes the check to become "if (NULL)" which
should always be dropped by the compiler.

Does providing a stub acpi_bus_get_device() for !CONFIG_ACPI actually help?

Rafael

--
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