lkml.org 
[lkml]   [2007]   [Jan]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] lib: kobject_put cleanup
Date
Hello,

This patch removes redundant argument checks for kobject_put().

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>

lib/kobject.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff -upr linux-2.6.20-rc2-mm1-a/lib/kobject.c linux-2.6.20-rc2-mm1-b/lib/kobject.c
--- linux-2.6.20-rc2-mm1-a/lib/kobject.c 2006-12-28 12:57:53.000000000 +0100
+++ linux-2.6.20-rc2-mm1-b/lib/kobject.c 2007-01-02 02:31:54.000000000 +0100
@@ -237,8 +237,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)
@@ -464,8 +463,7 @@ void kobject_cleanup(struct kobject * ko

if (s)
kset_put(s);
- if (parent)
- kobject_put(parent);
+ kobject_put(parent);
}

static void kobject_release(struct kref *kref)

--
Regards,

Mariusz Kozlowski
-
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: 2007-01-02 13:45    [W:0.033 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site