From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Cc: Jayachandran C <jchandra@digeo.com>,
"Jayachandran C." <c.jayachandran@gmail.com>,
Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 4/7] driver core: fix unnecessary NULL check in drivers/base/class.c
Date: Fri, 14 Apr 2006 13:09:56 -0700 [thread overview]
Message-ID: <11450453961756-git-send-email-greg@kroah.com> (raw)
In-Reply-To: <11450453961808-git-send-email-greg@kroah.com>
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
next prev parent reply other threads:[~2006-04-14 20:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-14 20:00 [GIT PATCH] Driver Core and sysfs patches for 2.6.17-rc1 Greg KH
2006-04-14 20:09 ` [PATCH 1/7] sysfs: Allow sysfs attribute files to be pollable Greg KH
2006-04-14 20:09 ` [PATCH 2/7] driver core: safely unbind drivers for devices not on a bus Greg KH
2006-04-14 20:09 ` [PATCH 3/7] BLOCK: delay all uevents until partition table is scanned Greg KH
2006-04-14 20:09 ` Greg KH [this message]
2006-04-14 20:09 ` [PATCH 5/7] driver core: driver_bind attribute returns incorrect value Greg KH
2006-04-14 20:09 ` [PATCH 6/7] pm: print name of failed suspend function Greg KH
2006-04-14 20:09 ` [PATCH 7/7] DMI: move dmi_scan.c from arch/i386 to drivers/firmware/ Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11450453961756-git-send-email-greg@kroah.com \
--to=greg@kroah.com \
--cc=c.jayachandran@gmail.com \
--cc=gregkh@suse.de \
--cc=jchandra@digeo.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.