[PATCH -next] Input: Remove unnecessary print function dev_err()

Yang Li posted 1 patch 4 years ago
drivers/input/joystick/sensehat-joystick.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
[PATCH -next] Input: Remove unnecessary print function dev_err()
Posted by Yang Li 4 years ago
The print function dev_err() is redundant because
platform_get_irq() already prints an error.

Eliminate the follow coccicheck warning:
./drivers/input/joystick/sensehat-joystick.c:102:2-9: line 102 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/input/joystick/sensehat-joystick.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/input/joystick/sensehat-joystick.c b/drivers/input/joystick/sensehat-joystick.c
index 5ad1fe4ff496..a84df39d3b2f 100644
--- a/drivers/input/joystick/sensehat-joystick.c
+++ b/drivers/input/joystick/sensehat-joystick.c
@@ -98,10 +98,8 @@ static int sensehat_joystick_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "Could not retrieve interrupt request");
+	if (irq < 0)
 		return irq;
-	}
 
 	error = devm_request_threaded_irq(&pdev->dev, irq,
 					  NULL, sensehat_joystick_report,
-- 
2.20.1.7.g153144c
Re: [PATCH -next] Input: Remove unnecessary print function dev_err()
Posted by Dmitry Torokhov 3 years, 10 months ago
On Wed, Apr 27, 2022 at 08:49:06AM +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/input/joystick/sensehat-joystick.c:102:2-9: line 102 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>

Applied, thank you.

-- 
Dmitry