linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [char-misc 1/2 4.3 V2] mei: Fix debugfs filename in error output
@ 2015-09-21  7:58 Tomas Winkler
  2015-10-04 11:19 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 7+ messages in thread
From: Tomas Winkler @ 2015-09-21  7:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Alexander Usyskin, linux-kernel, Alexander Kuleshov, Tomas Winkler

From: Alexander Kuleshov <kuleshovmail@gmail.com>

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
V2: fixed author address

 drivers/misc/mei/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c
index 4b469cf9e60f..c157f0ba575c 100644
--- a/drivers/misc/mei/debugfs.c
+++ b/drivers/misc/mei/debugfs.c
@@ -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,
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [char-misc 1/2 4.3 V2] mei: Fix debugfs filename in error output
  2015-09-21  7:58 [char-misc 1/2 4.3 V2] mei: Fix debugfs filename in error output Tomas Winkler
@ 2015-10-04 11:19 ` Greg Kroah-Hartman
  2015-10-05 14:47   ` Winkler, Tomas
  0 siblings, 1 reply; 7+ messages in thread
From: Greg Kroah-Hartman @ 2015-10-04 11:19 UTC (permalink / raw)
  To: Tomas Winkler; +Cc: Alexander Usyskin, linux-kernel, Alexander Kuleshov

On Mon, Sep 21, 2015 at 10:58:15AM +0300, Tomas Winkler wrote:
> From: Alexander Kuleshov <kuleshovmail@gmail.com>
> 
> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> ---
> V2: fixed author address
> 
>  drivers/misc/mei/debugfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c
> index 4b469cf9e60f..c157f0ba575c 100644
> --- a/drivers/misc/mei/debugfs.c
> +++ b/drivers/misc/mei/debugfs.c
> @@ -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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [char-misc 1/2 4.3 V2] mei: Fix debugfs filename in error output
  2015-10-04 11:19 ` Greg Kroah-Hartman
@ 2015-10-05 14:47   ` Winkler, Tomas
  2015-10-05 15:30     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 7+ messages in thread
From: Winkler, Tomas @ 2015-10-05 14:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Usyskin, Alexander, linux-kernel, Alexander Kuleshov

> 
> On Mon, Sep 21, 2015 at 10:58:15AM +0300, Tomas Winkler wrote:
> > From: Alexander Kuleshov <kuleshovmail@gmail.com>
> >
> > Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> > Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> > ---
> > V2: fixed author address
> >
> >  drivers/misc/mei/debugfs.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c
> > index 4b469cf9e60f..c157f0ba575c 100644
> > --- a/drivers/misc/mei/debugfs.c
> > +++ b/drivers/misc/mei/debugfs.c
> > @@ -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.

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
> "fail" if you don't have CONFIG_DEBUGFS enabled, 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 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [char-misc 1/2 4.3 V2] mei: Fix debugfs filename in error output
  2015-10-05 14:47   ` Winkler, Tomas
@ 2015-10-05 15:30     ` Greg Kroah-Hartman
  2015-10-06  8:46       ` Winkler, Tomas
  0 siblings, 1 reply; 7+ messages in thread
From: Greg Kroah-Hartman @ 2015-10-05 15:30 UTC (permalink / raw)
  To: Winkler, Tomas; +Cc: Usyskin, Alexander, linux-kernel, Alexander Kuleshov

On Mon, Oct 05, 2015 at 02:47:35PM +0000, Winkler, Tomas wrote:
> > 
> > On Mon, Sep 21, 2015 at 10:58:15AM +0300, Tomas Winkler wrote:
> > > From: Alexander Kuleshov <kuleshovmail@gmail.com>
> > >
> > > Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> > > Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> > > ---
> > > V2: fixed author address
> > >
> > >  drivers/misc/mei/debugfs.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c
> > > index 4b469cf9e60f..c157f0ba575c 100644
> > > --- a/drivers/misc/mei/debugfs.c
> > > +++ b/drivers/misc/mei/debugfs.c
> > > @@ -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.
> 
> 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.

>   Also, this will
> > "fail" if you don't have CONFIG_DEBUGFS enabled, which means you are
> > using the api wrong :(
> 
> The whole file is not compiled if CONFIG_DEBUGFS is not set, please see the Makefile 

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [char-misc 1/2 4.3 V2] mei: Fix debugfs filename in error output
  2015-10-05 15:30     ` Greg Kroah-Hartman
@ 2015-10-06  8:46       ` Winkler, Tomas
  2015-10-25 12:45         ` Winkler, Tomas
  0 siblings, 1 reply; 7+ messages in thread
From: Winkler, Tomas @ 2015-10-06  8:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Usyskin, Alexander, linux-kernel, Alexander Kuleshov

> > > >  		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.
 
> >   Also, this will
> > > "fail" if you don't have CONFIG_DEBUGFS enabled, which means you are
> > > using the api wrong :(
> >
> > The whole file is not compiled if CONFIG_DEBUGFS is not set, please see the
> Makefile
> 
> 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 :)

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 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [char-misc 1/2 4.3 V2] mei: Fix debugfs filename in error output
  2015-10-06  8:46       ` Winkler, Tomas
@ 2015-10-25 12:45         ` Winkler, Tomas
  2015-10-25 16:56           ` 'Greg Kroah-Hartman'
  0 siblings, 1 reply; 7+ messages in thread
From: Winkler, Tomas @ 2015-10-25 12:45 UTC (permalink / raw)
  To: 'Greg Kroah-Hartman'
  Cc: Usyskin, Alexander, 'linux-kernel@vger.kernel.org',
	'Alexander Kuleshov'

> 
> > > > >  		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.
> 
> > >   Also, this will
> > > > "fail" if you don't have CONFIG_DEBUGFS enabled, which means you are
> > > > using the api wrong :(
> > >
> > > The whole file is not compiled if CONFIG_DEBUGFS is not set, please see the
> > Makefile
> >
> > 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 :)
> 
> 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 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [char-misc 1/2 4.3 V2] mei: Fix debugfs filename in error output
  2015-10-25 12:45         ` Winkler, Tomas
@ 2015-10-25 16:56           ` 'Greg Kroah-Hartman'
  0 siblings, 0 replies; 7+ messages in thread
From: 'Greg Kroah-Hartman' @ 2015-10-25 16:56 UTC (permalink / raw)
  To: Winkler, Tomas
  Cc: Usyskin, Alexander, 'linux-kernel@vger.kernel.org',
	'Alexander Kuleshov'

On Sun, Oct 25, 2015 at 12:45:30PM +0000, Winkler, Tomas wrote:
> > 
> > > > > >  		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.
> > 
> > > >   Also, this will
> > > > > "fail" if you don't have CONFIG_DEBUGFS enabled, which means you are
> > > > > using the api wrong :(
> > > >
> > > > The whole file is not compiled if CONFIG_DEBUGFS is not set, please see the
> > > Makefile
> > >
> > > 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 :)
> > 
> > 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-10-25 16:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-21  7:58 [char-misc 1/2 4.3 V2] mei: Fix debugfs filename in error output Tomas Winkler
2015-10-04 11:19 ` Greg Kroah-Hartman
2015-10-05 14:47   ` Winkler, Tomas
2015-10-05 15:30     ` Greg Kroah-Hartman
2015-10-06  8:46       ` Winkler, Tomas
2015-10-25 12:45         ` Winkler, Tomas
2015-10-25 16:56           ` 'Greg Kroah-Hartman'

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).