public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] power: supply: Remove unnecessary print function dev_err()
@ 2022-05-04 13:52 Yang Li
  2022-06-09 19:30 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2022-05-04 13:52 UTC (permalink / raw)
  To: sre; +Cc: linux-pm, linux-kernel, Yang Li, Abaci Robot

The print function dev_err() is redundant because
platform_get_irq() already prints an error.

Eliminate the follow coccicheck warning:
./drivers/power/supply/goldfish_battery.c:225:2-9: line 225 is
redundant because platform_get_irq() already prints an error

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/power/supply/goldfish_battery.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/power/supply/goldfish_battery.c b/drivers/power/supply/goldfish_battery.c
index bf1754355c9f..a58d713d75ce 100644
--- a/drivers/power/supply/goldfish_battery.c
+++ b/drivers/power/supply/goldfish_battery.c
@@ -221,10 +221,8 @@ static int goldfish_battery_probe(struct platform_device *pdev)
 	}
 
 	data->irq = platform_get_irq(pdev, 0);
-	if (data->irq < 0) {
-		dev_err(&pdev->dev, "platform_get_irq failed\n");
+	if (data->irq < 0)
 		return -ENODEV;
-	}
 
 	ret = devm_request_irq(&pdev->dev, data->irq,
 			       goldfish_battery_interrupt,
-- 
2.20.1.7.g153144c


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

* Re: [PATCH -next] power: supply: Remove unnecessary print function dev_err()
  2022-05-04 13:52 [PATCH -next] power: supply: Remove unnecessary print function dev_err() Yang Li
@ 2022-06-09 19:30 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2022-06-09 19:30 UTC (permalink / raw)
  To: Yang Li; +Cc: linux-pm, linux-kernel, Abaci Robot

[-- Attachment #1: Type: text/plain, Size: 1256 bytes --]

Hi,

On Wed, May 04, 2022 at 09:52:14PM +0800, Yang Li wrote:
> The print function dev_err() is redundant because
> platform_get_irq() already prints an error.
> 
> Eliminate the follow coccicheck warning:
> ./drivers/power/supply/goldfish_battery.c:225:2-9: line 225 is
> redundant because platform_get_irq() already prints an error
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/goldfish_battery.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/power/supply/goldfish_battery.c b/drivers/power/supply/goldfish_battery.c
> index bf1754355c9f..a58d713d75ce 100644
> --- a/drivers/power/supply/goldfish_battery.c
> +++ b/drivers/power/supply/goldfish_battery.c
> @@ -221,10 +221,8 @@ static int goldfish_battery_probe(struct platform_device *pdev)
>  	}
>  
>  	data->irq = platform_get_irq(pdev, 0);
> -	if (data->irq < 0) {
> -		dev_err(&pdev->dev, "platform_get_irq failed\n");
> +	if (data->irq < 0)
>  		return -ENODEV;
> -	}
>  
>  	ret = devm_request_irq(&pdev->dev, data->irq,
>  			       goldfish_battery_interrupt,
> -- 
> 2.20.1.7.g153144c
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2022-06-09 19:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-04 13:52 [PATCH -next] power: supply: Remove unnecessary print function dev_err() Yang Li
2022-06-09 19:30 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox