* [PATCH -next] media: platform: Remove unnecessary print function dev_err()
@ 2022-03-16 0:14 Yang Li
2022-03-16 8:18 ` Miles Chen
0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2022-03-16 0:14 UTC (permalink / raw)
To: mchehab
Cc: matthias.bgg, tiffany.lin, andrew-ct.chen, linux-media,
linux-arm-kernel, linux-mediatek, 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 warnings:
./drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c:119:2-9:
line 119 is redundant because platform_get_irq() already prints an error
./drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c:103:2-9:
line 103 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/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c | 4 +---
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c
index 48dad9bb13d2..df7b25e9cbc8 100644
--- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c
+++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c
@@ -115,10 +115,8 @@ static int mtk_vcodec_init_dec_resources(struct mtk_vcodec_dev *dev)
return 0;
dev->dec_irq = platform_get_irq(pdev, 0);
- if (dev->dec_irq < 0) {
- dev_err(&pdev->dev, "failed to get irq number");
+ if (dev->dec_irq < 0)
return dev->dec_irq;
- }
irq_set_status_flags(dev->dec_irq, IRQ_NOAUTOEN);
ret = devm_request_irq(&pdev->dev, dev->dec_irq,
diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c
index 8d2a641d92f1..5f07313676bb 100644
--- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c
+++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c
@@ -99,10 +99,8 @@ static int mtk_vdec_hw_init_irq(struct mtk_vdec_hw_dev *dev)
int ret;
dev->dec_irq = platform_get_irq(pdev, 0);
- if (dev->dec_irq < 0) {
- dev_err(&pdev->dev, "Failed to get irq resource");
+ if (dev->dec_irq < 0)
return dev->dec_irq;
- }
irq_set_status_flags(dev->dec_irq, IRQ_NOAUTOEN);
ret = devm_request_irq(&pdev->dev, dev->dec_irq,
--
2.20.1.7.g153144c
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] media: platform: Remove unnecessary print function dev_err()
2022-03-16 0:14 [PATCH -next] media: platform: Remove unnecessary print function dev_err() Yang Li
@ 2022-03-16 8:18 ` Miles Chen
0 siblings, 0 replies; 2+ messages in thread
From: Miles Chen @ 2022-03-16 8:18 UTC (permalink / raw)
To: yang.lee
Cc: abaci, andrew-ct.chen, linux-arm-kernel, linux-kernel,
linux-media, linux-mediatek, matthias.bgg, mchehab, tiffany.lin
Hi Yang,
>The print function dev_err() is redundant because platform_get_irq()
>already prints an error.
>
>Eliminate the follow coccicheck warnings:
>./drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c:119:2-9:
>line 119 is redundant because platform_get_irq() already prints an error
>./drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c:103:2-9:
>line 103 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/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c | 4 +---
> drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c | 4 +---
> 2 files changed, 2 insertions(+), 6 deletions(-)
>
>diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c
>index 48dad9bb13d2..df7b25e9cbc8 100644
>--- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c
>+++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c
>@@ -115,10 +115,8 @@ static int mtk_vcodec_init_dec_resources(struct mtk_vcodec_dev *dev)
> return 0;
>
> dev->dec_irq = platform_get_irq(pdev, 0);
>- if (dev->dec_irq < 0) {
>- dev_err(&pdev->dev, "failed to get irq number");
>+ if (dev->dec_irq < 0)
> return dev->dec_irq;
>- }
>
Thanks for the patch,
Yihao has submitted a patch to fix mtk_vcodec_init_dec_resources() [1]
[1] https://lore.kernel.org/lkml/20220310023645.10082-1-hanyihao@vivo.com/
> irq_set_status_flags(dev->dec_irq, IRQ_NOAUTOEN);
> ret = devm_request_irq(&pdev->dev, dev->dec_irq,
>diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c
>index 8d2a641d92f1..5f07313676bb 100644
>--- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c
>+++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c
>@@ -99,10 +99,8 @@ static int mtk_vdec_hw_init_irq(struct mtk_vdec_hw_dev *dev)
> int ret;
>
> dev->dec_irq = platform_get_irq(pdev, 0);
>- if (dev->dec_irq < 0) {
>- dev_err(&pdev->dev, "Failed to get irq resource");
>+ if (dev->dec_irq < 0)
> return dev->dec_irq;
>- }
>
> irq_set_status_flags(dev->dec_irq, IRQ_NOAUTOEN);
> ret = devm_request_irq(&pdev->dev, dev->dec_irq,
Would you mind submitting mtk_vdec_hw_init_irq() part by another patch?
Thanks,
Miles
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-16 8:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16 0:14 [PATCH -next] media: platform: Remove unnecessary print function dev_err() Yang Li
2022-03-16 8:18 ` Miles Chen
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).