提交 a3a87d66 编写于 作者: A Andy Shevchenko 提交者: Greg Kroah-Hartman

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: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200324122023.9649-3-andriy.shevchenko@linux.intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 927f8287
...@@ -1199,7 +1199,7 @@ void driver_detach(struct device_driver *drv) ...@@ -1199,7 +1199,7 @@ void driver_detach(struct device_driver *drv)
spin_unlock(&drv->p->klist_devices.k_lock); spin_unlock(&drv->p->klist_devices.k_lock);
break; 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, struct device_private,
knode_driver.n_node); knode_driver.n_node);
dev = dev_prv->device; dev = dev_prv->device;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册