diff mbox series

[1/1] drm/mediatek: Remove redundant error printing in mtk_cec_probe()

Message ID 20210511113200.5439-1-thunder.leizhen@huawei.com (mailing list archive)
State New, archived
Headers show
Series [1/1] drm/mediatek: Remove redundant error printing in mtk_cec_probe() | expand

Commit Message

Leizhen (ThunderTown) May 11, 2021, 11:32 a.m. UTC
When devm_ioremap_resource() fails, a clear enough error message will be
printed by its subfunction __devm_ioremap_resource(). The error
information contains the device name, failure cause, and possibly resource
information.

Therefore, remove the error printing here to simplify code and reduce the
binary size.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/gpu/drm/mediatek/mtk_cec.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Baruch Siach May 11, 2021, 1:13 p.m. UTC | #1
Hi Zhen Lei,

On Tue, May 11 2021, Zhen Lei wrote:
> When devm_ioremap_resource() fails, a clear enough error message will be
> printed by its subfunction __devm_ioremap_resource(). The error
> information contains the device name, failure cause, and possibly resource
> information.
>
> Therefore, remove the error printing here to simplify code and reduce the
> binary size.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_cec.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_cec.c b/drivers/gpu/drm/mediatek/mtk_cec.c
> index e9cef5c0c8f7eff..fd593ff99bfd447 100644
> --- a/drivers/gpu/drm/mediatek/mtk_cec.c
> +++ b/drivers/gpu/drm/mediatek/mtk_cec.c
> @@ -197,7 +197,6 @@ static int mtk_cec_probe(struct platform_device *pdev)
>  	cec->regs = devm_ioremap_resource(dev, res);
>  	if (IS_ERR(cec->regs)) {
>  		ret = PTR_ERR(cec->regs);
> -		dev_err(dev, "Failed to ioremap cec: %d\n", ret);
>  		return ret;

You can just return PTR_ERR() directly. No need to set 'ret'.

baruch

>  	}
Leizhen (ThunderTown) May 11, 2021, 1:18 p.m. UTC | #2
On 2021/5/11 21:13, Baruch Siach wrote:
> Hi Zhen Lei,
> 
> On Tue, May 11 2021, Zhen Lei wrote:
>> When devm_ioremap_resource() fails, a clear enough error message will be
>> printed by its subfunction __devm_ioremap_resource(). The error
>> information contains the device name, failure cause, and possibly resource
>> information.
>>
>> Therefore, remove the error printing here to simplify code and reduce the
>> binary size.
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>> ---
>>  drivers/gpu/drm/mediatek/mtk_cec.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/mediatek/mtk_cec.c b/drivers/gpu/drm/mediatek/mtk_cec.c
>> index e9cef5c0c8f7eff..fd593ff99bfd447 100644
>> --- a/drivers/gpu/drm/mediatek/mtk_cec.c
>> +++ b/drivers/gpu/drm/mediatek/mtk_cec.c
>> @@ -197,7 +197,6 @@ static int mtk_cec_probe(struct platform_device *pdev)
>>  	cec->regs = devm_ioremap_resource(dev, res);
>>  	if (IS_ERR(cec->regs)) {
>>  		ret = PTR_ERR(cec->regs);
>> -		dev_err(dev, "Failed to ioremap cec: %d\n", ret);
>>  		return ret;
> 
> You can just return PTR_ERR() directly. No need to set 'ret'.

Right, I will fix it tomorrow.

> 
> baruch
> 
>>  	}
> 
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mediatek/mtk_cec.c b/drivers/gpu/drm/mediatek/mtk_cec.c
index e9cef5c0c8f7eff..fd593ff99bfd447 100644
--- a/drivers/gpu/drm/mediatek/mtk_cec.c
+++ b/drivers/gpu/drm/mediatek/mtk_cec.c
@@ -197,7 +197,6 @@  static int mtk_cec_probe(struct platform_device *pdev)
 	cec->regs = devm_ioremap_resource(dev, res);
 	if (IS_ERR(cec->regs)) {
 		ret = PTR_ERR(cec->regs);
-		dev_err(dev, "Failed to ioremap cec: %d\n", ret);
 		return ret;
 	}