Re: [PATCH] clk / soc: mediatek: fix ptr_ret.cocci warnings

From: Matthias Brugger
Date: Fri May 15 2020 - 07:20:57 EST




On 10/05/2020 12:07, Enric Balletbo i Serra wrote:
>
>
> On 10/5/20 4:53, kbuild test robot wrote:
>> From: kbuild test robot <lkp@xxxxxxxxx>
>>
>> drivers/soc/mediatek/mtk-mmsys.c:28:1-3: WARNING: PTR_ERR_OR_ZERO can be used
>>
>>
>> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
>>
>> Generated by: scripts/coccinelle/api/ptr_ret.cocci
>>
>> Fixes: 13032709e232 ("clk / soc: mediatek: Move mt8173 MMSYS to platform driver")
>> CC: Matthias Brugger <mbrugger@xxxxxxxx>
>> Signed-off-by: kbuild test robot <lkp@xxxxxxxxx>
>
> Reviewed-by: Enric Balletbo i Serra <enric.balletbo@xxxxxxxxxxxxx>
>

Since we have
667c769246b0 ("soc / drm: mediatek: Fix mediatek-drm device probing")

I think this is not a valid patch anymore.

Regards,
Matthias

>> ---
>>
>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
>> head: 30e2206e11ce27ae910cc0dab21472429e400a87
>> commit: 13032709e2328553970f0002df5edce6aac69425 [1266/7905] clk / soc: mediatek: Move mt8173 MMSYS to platform driver
>>
>> mtk-mmsys.c | 5 +----
>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> --- a/drivers/soc/mediatek/mtk-mmsys.c
>> +++ b/drivers/soc/mediatek/mtk-mmsys.c
>> @@ -25,10 +25,7 @@ static int mtk_mmsys_probe(struct platfo
>>
>> clks = platform_device_register_data(&pdev->dev, data->clk_driver,
>> PLATFORM_DEVID_AUTO, NULL, 0);
>> - if (IS_ERR(clks))
>> - return PTR_ERR(clks);
>> -
>> - return 0;
>> + return PTR_ERR_OR_ZERO(clks);
>> }
>>
>> static const struct of_device_id of_match_mtk_mmsys[] = {
>>