patch "kobject: don't use WARN for registration failures" added to driver-core-linus
Subsystems (3)
This is a note to let you know that I've just added the patch titled
kobject: don't use WARN for registration failures
to my driver-core git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
in the driver-core-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
Quoted 1 line
From
3e14c6abbfb5c94506edda9d8e2c145d79375798Mon Sep 17 00:00:00 2001
From: Dmitry Vyukov <[email protected]>
Date: Wed, 11 Apr 2018 17:22:43 +0200
Subject: kobject: don't use WARN for registration failures
This WARNING proved to be noisy. The function still returns an error and callers should handle it. That's how most of kernel code works. Downgrade the WARNING to pr_err() and leave WARNINGs for kernel bugs.
--- lib/kobject.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
lib/kobject.c +5 -6
@@ -233,13 +233,12 @@ static int kobject_add_internal(struct kobject *kobj)/* be noisy on error issues */ if (error == -EEXIST ) -WARN (1 , -"%s failed for %s with -EEXIST, don't try to register things with the same name in the same directory.\n" , - __func__,kobject_name (kobj)); +pr_err ("%s failed for %s with -EEXIST, don't try to register things with the same name in the same directory.\n" , + __func__,kobject_name (kobj));else -WARN (1 ,"%s failed for %s (error: %d parent: %s)\n" , - __func__,kobject_name (kobj), error, - parent ?kobject_name (parent) :"'none'" ); +pr_err ("%s failed for %s (error: %d parent: %s)\n" , + __func__,kobject_name (kobj), error, + parent ?kobject_name (parent) :"'none'" ); }else kobj->state_in_sysfs =1 ;
Signature · 1 line
2.17.0