mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 11:03:43 +02:00
ACPI: scan: Use list_first_entry_or_null() in acpi_device_hid()
To replace list_empty() + list_first_entry() pair to simplify code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
3361530532
commit
2649a0f29a
|
|
@ -1298,10 +1298,10 @@ const char *acpi_device_hid(struct acpi_device *device)
|
|||
{
|
||||
struct acpi_hardware_id *hid;
|
||||
|
||||
if (list_empty(&device->pnp.ids))
|
||||
hid = list_first_entry_or_null(&device->pnp.ids, struct acpi_hardware_id, list);
|
||||
if (!hid)
|
||||
return dummy_hid;
|
||||
|
||||
hid = list_first_entry(&device->pnp.ids, struct acpi_hardware_id, list);
|
||||
return hid->id;
|
||||
}
|
||||
EXPORT_SYMBOL(acpi_device_hid);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user