mei: Fix debugfs filename in error output
Subsystems (2)
PATCH v2 1/2 mei: Fix debugfs filename in error output
From: Alexander Kuleshov <[email protected]>
---
V2: fixed author address
drivers/misc/mei/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/mei/debugfs.c +1 -1
@@ -213,7 +213,7 @@ int mei_dbgfs_register(struct mei_device *dev, const char *name) f =debugfs_create_file ("active" ,S_IRUSR , dir, dev, &mei_dbgfs_fops_active);if (!f) { -dev_err (dev->dev,"meclients: registration failed\n" ); +dev_err (dev->dev,"active: registration failed\n" ); goto err; } f = debugfs_create_file("devstate", S_IRUSR, dir,
Signature · 1 line
2.4.3
Greg Kroah-Hartman
maintainerQuoted 15 lines · Tomas Winkler
From: Alexander Kuleshov <[email protected]>
Signed-off-by Alexander Kuleshov <[email protected]>Signed-off-by Tomas Winkler <[email protected]>---
V2: fixed author addressdrivers/misc/mei/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/mei/debugfs.c +0
-0
drivers/misc/mei/debugfs.c int mei_dbgfs_register(struct mei_device *dev, const char *name) · line 217
Quoted 6 lines
drivers/misc/mei/debugfs.c +1
-1@@ -213,7 +213,7 @@ int mei_dbgfs_register(struct mei_device *dev, const char *name) f =debugfs_create_file ("active" ,S_IRUSR , dir, dev, &mei_dbgfs_fops_active);if (!f) { -dev_err (dev->dev,"meclients: registration failed\n" ); +dev_err (dev->dev,"active: registration failed\n" ); goto err;
You should never care if a debugfs call fails or not. Also, this will "fail" if you don't have CONFIG_DEBUGFS enabled, which means you are using the api wrong :(
greg k-h
Quoted 18 lines · Tomas Winkler
drivers/misc/mei/debugfs.c int mei_dbgfs_register(struct mei_device *dev, const
Quoted 15 lines
From: Alexander Kuleshov <[email protected]>
Signed-off-by Alexander Kuleshov <[email protected]>Signed-off-by Tomas Winkler <[email protected]>---
V2: fixed author addressdrivers/misc/mei/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/mei/debugfs.c +0
-0@@ -213,7 +213,7 @@ int mei_dbgfs_register(struct mei_device *dev, constchar *name)
Quoted 8 lines
drivers/misc/mei/debugfs.c int mei_dbgfs_register(struct mei_device *dev, const char *name) · line 217
Quoted 6 lines
drivers/misc/mei/debugfs.c +1
-1f =debugfs_create_file ("active" ,S_IRUSR , dir, dev, &mei_dbgfs_fops_active);if (!f) { -dev_err (dev->dev,"meclients: registration failed\n" ); +dev_err (dev->dev,"active: registration failed\n" ); goto err;You should never care if a debugfs call fails or not.
The system should not be dependent on the debug feature but, it is always good to know if there our system is failing
Also, this will
Quoted 2 lines
"fail" if you don't have
CONFIG_DEBUGFSenabled, which means you are using the api wrong :(
The whole file is not compiled if CONFIG_DEBUGFS is not set, please see the Makefile
Thanks
Tomas
Greg Kroah-Hartman
maintainerQuoted 27 lines · Tomas
Quoted 18 lines · Tomas Winkler
drivers/misc/mei/debugfs.c int mei_dbgfs_register(struct mei_device *dev, const
Quoted 15 lines
From: Alexander Kuleshov <[email protected]>
Signed-off-by Alexander Kuleshov <[email protected]>Signed-off-by Tomas Winkler <[email protected]>---
V2: fixed author addressdrivers/misc/mei/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/mei/debugfs.c +0
-0@@ -213,7 +213,7 @@ int mei_dbgfs_register(struct mei_device *dev, constchar *name)
Quoted 8 lines
drivers/misc/mei/debugfs.c int mei_dbgfs_register(struct mei_device *dev, const char *name) · line 217
Quoted 6 lines
drivers/misc/mei/debugfs.c +1
-1f =debugfs_create_file ("active" ,S_IRUSR , dir, dev, &mei_dbgfs_fops_active);if (!f) { -dev_err (dev->dev,"meclients: registration failed\n" ); +dev_err (dev->dev,"active: registration failed\n" ); goto err;You should never care if a debugfs call fails or not.
Quoted 2 lines
The system should not be dependent on the debug feature but, it is always good to know if there our system is failing
And what can you do if it is "failing"? Really nothing, so there's nothing to check here.
Quoted 5 lines
Also, this will
Quoted 2 lines
"fail" if you don't have
CONFIG_DEBUGFSenabled, which means you are using the api wrong :(The whole file is not compiled if
CONFIG_DEBUGFSis not set, please see theMakefile
Ok, then you don't need to check anything. Debugfs was created to be dirt-simple, don't add complexity and "must unwind cleanly" type logic here where it's not needed at all. That just hurts my sensibilities for why I made the API the way it is in the first place :)
thanks,
greg k-h
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
goto err;
You should never care if a debugfs call fails or not.
The system should not be dependent on the debug feature but, it is always good to know if there our system is failing
And what can you do if it is "failing"? Really nothing, so there's nothing to check here.
As far as I can see the function debugfs_create_file may fail for a few reasons and it return NULL if this is happening. I might ignore the error as you suggested, but I'm not sure why not to give a hint in log that this happened. Second, as far as I scanned the kernel sources, checking the return value of this function and acting on this is very common.
Quoted 11 lines
Quoted 5 lines
Also, this will
Quoted 2 lines
"fail" if you don't have
CONFIG_DEBUGFSenabled, which means you are using the api wrong :(The whole file is not compiled if
CONFIG_DEBUGFSis not set, please see the
MakefileOk, then you don't need to check anything. Debugfs was created to be dirt-simple, don't add complexity and "must unwind cleanly" type logic here where it's not needed at all. That just hurts my sensibilities for why I made the API the way it is in the first place :)
I don't see the code much complex, it is pretty much boilerplate code and this is why this c&p error had happened. So this patch just fixes a c&p error in an error message and if we wish to change the behavior to match your vision I suggest to doing it another patch set... maybe even sweeping the whole kernel.
Thanks
Tomas
Quoted 30 lines
Quoted 10 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
goto err;
You should never care if a debugfs call fails or not.
The system should not be dependent on the debug feature but, it is always good to know if there our system is failing
And what can you do if it is "failing"? Really nothing, so there's nothing to check here.
As far as I can see the function
debugfs_create_filemay fail for a few reasons and it return NULL if this is happening.
I might ignore the error as you suggested, but I'm not sure why not to give a hint in log that this happened.
Second, as far as I scanned the kernel sources, checking the return value of this function and acting on this is very common.Quoted 11 lines
Quoted 5 lines
Also, this will
Quoted 2 lines
"fail" if you don't have
CONFIG_DEBUGFSenabled, which means you are using the api wrong :(The whole file is not compiled if
CONFIG_DEBUGFSis not set, please see the
MakefileOk, then you don't need to check anything. Debugfs was created to be dirt-simple, don't add complexity and "must unwind cleanly" type logic here where it's not needed at all. That just hurts my sensibilities for why I made the API the way it is in the first place :)
Quoted 5 lines
I don't see the code much complex, it is pretty much boilerplate code and this is why this c&p error had happened.
So this patch just fixes a c&p error in an error message and if we wish to change the behavior to match your vision
I suggest to doing it another patch set... maybe even sweeping the whole kernel.
Greg, are you merging this patch? What is your final say?
Thanks
Tomas
'Greg Kroah-Hartman'
maintainerQuoted 30 lines · Tomas
Quoted 30 lines
Quoted 10 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
goto err;
You should never care if a debugfs call fails or not.
The system should not be dependent on the debug feature but, it is always good to know if there our system is failing
And what can you do if it is "failing"? Really nothing, so there's nothing to check here.
As far as I can see the function
debugfs_create_filemay fail for a few reasons and it return NULL if this is happening.
I might ignore the error as you suggested, but I'm not sure why not to give a hint in log that this happened.
Second, as far as I scanned the kernel sources, checking the return value of this function and acting on this is very common.Quoted 11 lines
Quoted 5 lines
Also, this will
Quoted 2 lines
"fail" if you don't have
CONFIG_DEBUGFSenabled, which means you are using the api wrong :(The whole file is not compiled if
CONFIG_DEBUGFSis not set, please see the
MakefileOk, then you don't need to check anything. Debugfs was created to be dirt-simple, don't add complexity and "must unwind cleanly" type logic here where it's not needed at all. That just hurts my sensibilities for why I made the API the way it is in the first place :)
Quoted 8 lines
Quoted 5 lines
I don't see the code much complex, it is pretty much boilerplate code and this is why this c&p error had happened.
So this patch just fixes a c&p error in an error message and if we wish to change the behavior to match your vision
I suggest to doing it another patch set... maybe even sweeping the whole kernel.Greg, are you merging this patch? What is your final say?
It's no longer in my todo queue, so there's nothing for me to apply here, sorry.
Please resend it if you feel it should be added.
thanks,
greg k-h