From m.kozlowski@tuxland.pl Tue Jan 2 04:43:22 2007 From: Mariusz Kozlowski To: Greg KH Subject: kobject: kobject_put cleanup Date: Tue, 2 Jan 2007 13:44:44 +0100 Cc: linux-kernel@vger.kernel.org Message-Id: <200701021344.44258.m.kozlowski@tuxland.pl> This patch removes redundant argument checks for kobject_put(). Signed-off-by: Mariusz Kozlowski Signed-off-by: Greg Kroah-Hartman --- lib/kobject.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- gregkh-2.6.orig/lib/kobject.c +++ gregkh-2.6/lib/kobject.c @@ -195,8 +195,7 @@ int kobject_add(struct kobject * kobj) if (error) { /* unlink does the kobject_put() for us */ unlink(kobj); - if (parent) - kobject_put(parent); + kobject_put(parent); /* be noisy on error issues */ if (error == -EEXIST) @@ -420,8 +419,7 @@ void kobject_cleanup(struct kobject * ko t->release(kobj); if (s) kset_put(s); - if (parent) - kobject_put(parent); + kobject_put(parent); } static void kobject_release(struct kref *kref)