All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: dell-smo8800: Possible unnecessary 'out of memory' message
@ 2017-12-13  8:23 Dhaval Shah
  2017-12-13  8:30 ` Pali Rohár
  0 siblings, 1 reply; 5+ messages in thread
From: Dhaval Shah @ 2017-12-13  8:23 UTC (permalink / raw)
  To: pali.rohar, dvhart, andy; +Cc: platform-driver-x86, linux-kernel, Dhaval Shah

Removed Possible unnecessary 'out of memory' message checkpatch warnings.
Issue found by checkpatch.

Signed-off-by: Dhaval Shah <dhaval.shah@softnautics.com>
---
 drivers/platform/x86/dell-smo8800.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/platform/x86/dell-smo8800.c b/drivers/platform/x86/dell-smo8800.c
index 1d87237bc731..9590d5e7c5ca 100644
--- a/drivers/platform/x86/dell-smo8800.c
+++ b/drivers/platform/x86/dell-smo8800.c
@@ -150,10 +150,8 @@ static int smo8800_add(struct acpi_device *device)
 	struct smo8800_device *smo8800;
 
 	smo8800 = devm_kzalloc(&device->dev, sizeof(*smo8800), GFP_KERNEL);
-	if (!smo8800) {
-		dev_err(&device->dev, "failed to allocate device data\n");
+	if (!smo8800)
 		return -ENOMEM;
-	}
 
 	smo8800->dev = &device->dev;
 	smo8800->miscdev.minor = MISC_DYNAMIC_MINOR;
-- 
2.11.0

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

* Re: [PATCH] platform/x86: dell-smo8800: Possible unnecessary 'out of memory' message
  2017-12-13  8:23 [PATCH] platform/x86: dell-smo8800: Possible unnecessary 'out of memory' message Dhaval Shah
@ 2017-12-13  8:30 ` Pali Rohár
  2017-12-13  9:40     ` Dhaval Shah
  2017-12-14 18:02   ` Andy Shevchenko
  0 siblings, 2 replies; 5+ messages in thread
From: Pali Rohár @ 2017-12-13  8:30 UTC (permalink / raw)
  To: Dhaval Shah; +Cc: dvhart, andy, platform-driver-x86, linux-kernel

On Wednesday 13 December 2017 13:53:54 Dhaval Shah wrote:
> Removed Possible unnecessary 'out of memory' message checkpatch warnings.
> Issue found by checkpatch.
> 
> Signed-off-by: Dhaval Shah <dhaval.shah@softnautics.com>
> ---
>  drivers/platform/x86/dell-smo8800.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/platform/x86/dell-smo8800.c b/drivers/platform/x86/dell-smo8800.c
> index 1d87237bc731..9590d5e7c5ca 100644
> --- a/drivers/platform/x86/dell-smo8800.c
> +++ b/drivers/platform/x86/dell-smo8800.c
> @@ -150,10 +150,8 @@ static int smo8800_add(struct acpi_device *device)
>  	struct smo8800_device *smo8800;
>  
>  	smo8800 = devm_kzalloc(&device->dev, sizeof(*smo8800), GFP_KERNEL);
> -	if (!smo8800) {
> -		dev_err(&device->dev, "failed to allocate device data\n");

Hi! Any particular reason for removing error message?

> +	if (!smo8800)
>  		return -ENOMEM;
> -	}
>  
>  	smo8800->dev = &device->dev;
>  	smo8800->miscdev.minor = MISC_DYNAMIC_MINOR;

-- 
Pali Rohár
pali.rohar@gmail.com

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

* Re: [PATCH] platform/x86: dell-smo8800: Possible unnecessary 'out of memory' message
  2017-12-13  8:30 ` Pali Rohár
@ 2017-12-13  9:40     ` Dhaval Shah
  2017-12-14 18:02   ` Andy Shevchenko
  1 sibling, 0 replies; 5+ messages in thread
From: Dhaval Shah @ 2017-12-13  9:40 UTC (permalink / raw)
  To: Pali Rohár; +Cc: dvhart, andy, platform-driver-x86, linux-kernel

Hi Pali Rohar,

Thanks for the review.

________________________________________
> From: Pali Rohár <pali.rohar@gmail.com>
> Sent: Wednesday, December 13, 2017 2:00 PM
> To: Dhaval Shah
> Cc: dvhart@infradead.org; andy@infradead.org; platform-driver-x86@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] platform/x86: dell-smo8800: Possible unnecessary 'out of memory' message
> 
> On Wednesday 13 December 2017 13:53:54 Dhaval Shah wrote:
> > Removed Possible unnecessary 'out of memory' message checkpatch warnings.
> > Issue found by checkpatch.
> >
> > Signed-off-by: Dhaval Shah <dhaval.shah@softnautics.com>
> > ---
> >  drivers/platform/x86/dell-smo8800.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/drivers/platform/x86/dell-smo8800.c b/drivers/platform/x86/dell-smo8800.c
> > index 1d87237bc731..9590d5e7c5ca 100644
> > --- a/drivers/platform/x86/dell-smo8800.c
> > +++ b/drivers/platform/x86/dell-smo8800.c
> > @@ -150,10 +150,8 @@ static int smo8800_add(struct acpi_device *device)
> >       struct smo8800_device *smo8800;
> >
> >       smo8800 = devm_kzalloc(&device->dev, sizeof(*smo8800), GFP_KERNEL);
> > -     if (!smo8800) {
> > -             dev_err(&device->dev, "failed to allocate device data\n");
> 
> Hi! Any particular reason for removing error message?
> 
When you give the -ENOMEM as error in return then this message info will be provided by the kernel subsystem. no need to give this printk and that's why checkpatch gives warning in this case.
> > +     if (!smo8800)
> >               return -ENOMEM;
> > -     }
> >
> >       smo8800->dev = &device->dev;
> >       smo8800->miscdev.minor = MISC_DYNAMIC_MINOR;

--
Pali Rohár
pali.rohar@gmail.com

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

* Re: [PATCH] platform/x86: dell-smo8800: Possible unnecessary 'out of memory' message
@ 2017-12-13  9:40     ` Dhaval Shah
  0 siblings, 0 replies; 5+ messages in thread
From: Dhaval Shah @ 2017-12-13  9:40 UTC (permalink / raw)
  To: Pali Rohár; +Cc: dvhart, andy, platform-driver-x86, linux-kernel

Hi Pali Rohar,

Thanks for the review.

________________________________________
> From: Pali Rohár <pali.rohar@gmail.com>
> Sent: Wednesday, December 13, 2017 2:00 PM
> To: Dhaval Shah
> Cc: dvhart@infradead.org; andy@infradead.org; platform-driver-x86@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] platform/x86: dell-smo8800: Possible unnecessary 'out of memory' message
> 
> On Wednesday 13 December 2017 13:53:54 Dhaval Shah wrote:
> > Removed Possible unnecessary 'out of memory' message checkpatch warnings.
> > Issue found by checkpatch.
> >
> > Signed-off-by: Dhaval Shah <dhaval.shah@softnautics.com>
> > ---
> >  drivers/platform/x86/dell-smo8800.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/drivers/platform/x86/dell-smo8800.c b/drivers/platform/x86/dell-smo8800.c
> > index 1d87237bc731..9590d5e7c5ca 100644
> > --- a/drivers/platform/x86/dell-smo8800.c
> > +++ b/drivers/platform/x86/dell-smo8800.c
> > @@ -150,10 +150,8 @@ static int smo8800_add(struct acpi_device *device)
> >       struct smo8800_device *smo8800;
> >
> >       smo8800 = devm_kzalloc(&device->dev, sizeof(*smo8800), GFP_KERNEL);
> > -     if (!smo8800) {
> > -             dev_err(&device->dev, "failed to allocate device data\n");
> 
> Hi! Any particular reason for removing error message?
> 
When you give the -ENOMEM as error in return then this message info will be provided by the kernel subsystem. no need to give this printk and that's why checkpatch gives warning in this case.
> > +     if (!smo8800)
> >               return -ENOMEM;
> > -     }
> >
> >       smo8800->dev = &device->dev;
> >       smo8800->miscdev.minor = MISC_DYNAMIC_MINOR;

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

* Re: [PATCH] platform/x86: dell-smo8800: Possible unnecessary 'out of memory' message
  2017-12-13  8:30 ` Pali Rohár
  2017-12-13  9:40     ` Dhaval Shah
@ 2017-12-14 18:02   ` Andy Shevchenko
  1 sibling, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2017-12-14 18:02 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Dhaval Shah, dvhart, Andy Shevchenko, Platform Driver, linux-kernel

On Wed, Dec 13, 2017 at 10:30 AM, Pali Rohár <pali.rohar@gmail.com> wrote:
> On Wednesday 13 December 2017 13:53:54 Dhaval Shah wrote:
>> Removed Possible unnecessary 'out of memory' message checkpatch warnings.
>> Issue found by checkpatch.

>> -             dev_err(&device->dev, "failed to allocate device data\n");
>
> Hi! Any particular reason for removing error message?

If you look into drivers/base/dd.c (real_probe() function IIRC) it
issues a warning when probe fails with error code.
So, basically all error messages in ->probe() are redundant (except
maybe those that prints more than error message itself).

-- 
With Best Regards,
Andy Shevchenko

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

end of thread, other threads:[~2017-12-14 18:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-13  8:23 [PATCH] platform/x86: dell-smo8800: Possible unnecessary 'out of memory' message Dhaval Shah
2017-12-13  8:30 ` Pali Rohár
2017-12-13  9:40   ` Dhaval Shah
2017-12-13  9:40     ` Dhaval Shah
2017-12-14 18:02   ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.