Commit db176c6ed8974fae94328ad5ac9e70b094ff22fd

Authored by OGAWA Hirofumi
Committed by Linus Torvalds
1 parent 6ce07c7b61

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 <hirofumi@mail.parknet.co.jp>
Cc: Greg KH <gregkh@suse.de>
Cc: Len Brown <lenb@kernel.org>
[ Version 2 totally redone based on suggestions from Linus & Greg ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 2 deletions Side-by-side Diff

... ... @@ -175,8 +175,7 @@
175 175 }
176 176  
177 177 /* Check whether this driver has already been added to a class. */
178   - if ((drv->entry.next != drv->entry.prev) ||
179   - (drv->entry.next != NULL)) {
  178 + if (drv->entry.next && !list_empty(&drv->entry)) {
180 179 printk(KERN_WARNING "sysdev: class %s: driver (%p) has already"
181 180 " been registered to a class, something is wrong, but "
182 181 "will forge on!\n", cls->name, drv);