Skip to contentSkip to conversation

sample/kobject: update kset-example code

PATCH Applied Jeff Liu 3 participants 3 messages Jun 17, 2014

lore
Share & tools
lore

Jeff Liu

author
#0 lore raw

PATCH 2/24 sample/kobject: update kset-example code

From: Jie Liu <[email protected]>
Subject: sample/kobject: update kset-example code

Check and return the error ptr if call kset_create_and_add() failed

Cc Christoph Lameter <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Andrew Morton <[email protected]>
---
 samples/kobject/kset-example.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
samples/kobject/kset-example.c +2 -2
index ab5e447..c2911d9 100644
@@ -238,8 +238,8 @@ static int __init example_init(void)
 	 * located under /sys/kernel/
 	 */
 	example_kset = kset_create_and_add("kset_example", NULL, kernel_kobj);
-	if (!example_kset)
-		return -ENOMEM;
+	if (IS_ERR(example_kset))
+		return PTR_ERR(example_kset);
 
 	/*
 	 * Create three objects and register them with our kset
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 5 lines · Jeff Liu

From: Jie Liu <[email protected]>
Subject: sample/kobject: update kset-example code

Check and return the error ptr if call kset_create_and_add() failed

Quoted 7 lines
Cc Christoph Lameter <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Andrew Morton <[email protected]>
---
 samples/kobject/kset-example.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Nope, not taking this, sorry.

greg k-h

#2 lore raw
Quoted 14 lines · Greg KH
Quoted 5 lines · Jeff Liu

From: Jie Liu <[email protected]>
Subject: sample/kobject: update kset-example code

Check and return the error ptr if call kset_create_and_add() failed

Quoted 7 lines
Cc Christoph Lameter <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Andrew Morton <[email protected]>
---
 samples/kobject/kset-example.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 1 line

Nope, not taking this, sorry.

Ok. I will then accept the first patch to slub.c that you sent which simply returns -ENOMEM. Please resend that one.