From: OGAWA Hirofumi Date: Tue, 6 May 2008 19:02:53 +0000 (+0900) Subject: Fix bogus warning in sysdev_driver_register() X-Git-Tag: Ubuntu-5.4-5.4.0-11.14~36671 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=db176c6ed8974fae94328ad5ac9e70b094ff22fd;p=mirror_ubuntu-focal-kernel.git Fix bogus warning in sysdev_driver_register() if ((drv->entry.next != drv->entry.prev) || (drv->entry.next != NULL)) { warns list_empty(&drv->entry). Signed-off-by: OGAWA Hirofumi Cc: Greg KH Cc: Len Brown [ Version 2 totally redone based on suggestions from Linus & Greg ] Signed-off-by: Linus Torvalds --- diff --git a/drivers/base/sys.c b/drivers/base/sys.c index 4fbb56bcb1ee..358bb0be3c08 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c @@ -175,8 +175,7 @@ int sysdev_driver_register(struct sysdev_class *cls, struct sysdev_driver *drv) } /* Check whether this driver has already been added to a class. */ - if ((drv->entry.next != drv->entry.prev) || - (drv->entry.next != NULL)) { + if (drv->entry.next && !list_empty(&drv->entry)) { printk(KERN_WARNING "sysdev: class %s: driver (%p) has already" " been registered to a class, something is wrong, but " "will forge on!\n", cls->name, drv);