lkml.org 
[lkml]   [2006]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 4/7] driver core: fix unnecessary NULL check in drivers/base/class.c
Date
From
This patch tries to fix an issue in drivers/base/class.c, please
review and apply if correct.

Patch Description:
"parent_class" is checked for NULL already, so removed the unnecessary
check.

Signed-off-by: Jayachandran C. <c.jayachandran@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---

drivers/base/class.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)

a14388904ca67197c9a531dba2358d8131697865
diff --git a/drivers/base/class.c b/drivers/base/class.c
index df7fdab..0e71dff 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -562,14 +562,13 @@ int class_device_add(struct class_device
kobject_uevent(&class_dev->kobj, KOBJ_ADD);

/* notify any interfaces this device is now here */
- if (parent_class) {
- down(&parent_class->sem);
- list_add_tail(&class_dev->node, &parent_class->children);
- list_for_each_entry(class_intf, &parent_class->interfaces, node)
- if (class_intf->add)
- class_intf->add(class_dev, class_intf);
- up(&parent_class->sem);
+ down(&parent_class->sem);
+ list_add_tail(&class_dev->node, &parent_class->children);
+ list_for_each_entry(class_intf, &parent_class->interfaces, node) {
+ if (class_intf->add)
+ class_intf->add(class_dev, class_intf);
}
+ up(&parent_class->sem);

register_done:
if (error) {
--
1.2.6

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-14 22:15    [W:0.035 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site