From: Andy Shevchenko Date: Tue, 24 Mar 2020 12:20:23 +0000 (+0200) Subject: driver core: Replace open-coded list_last_entry() X-Git-Tag: v5.7-rc1~191^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a3a87d66d3f64c74acbc25799d38effb63695ea0;p=thirdparty%2Fkernel%2Flinux.git driver core: Replace open-coded list_last_entry() There is a place in the code where open-coded version of list entry accessors list_last_entry() is used. Replace that with the standard macro. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200324122023.9649-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 3f5b8bdd94f0b..06ec0e851fa16 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -1199,7 +1199,7 @@ void driver_detach(struct device_driver *drv) spin_unlock(&drv->p->klist_devices.k_lock); break; } - dev_prv = list_entry(drv->p->klist_devices.k_list.prev, + dev_prv = list_last_entry(&drv->p->klist_devices.k_list, struct device_private, knode_driver.n_node); dev = dev_prv->device;