lkml.org 
[lkml]   [2020]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] phy: tegra: Use PTR_ERR_OR_ZERO() to simplify code
From
Date
Thanks for pushing this change.
I'm fine with this change as it is attempting to change only the last
occurrence of the (IS_ERR(...)) + PTR_ERR combination.
But, this code was initially written with PTR_ERR_OR_ZERO() itself but
later changed to use (IS_ERR(...)) + PTR_ERR based on the review comment
from Dmitry Osipenko ( https://lkml.org/lkml/2019/6/20/1457 )

Adding Dmitry as well to review the change.

I'm fine with this change.
Reviewed-by: Vidya Sagar <vidyas@nvidia.com>

On 05-May-20 8:30 PM, Aishwarya Ramakrishnan wrote:
> External email: Use caution opening links or attachments
>
>
> PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR.
>
> Generated by: scripts/coccinelle/api/ptr_ret.cocci
>
> Signed-off-by: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com>
> ---
> drivers/phy/tegra/phy-tegra194-p2u.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/phy/tegra/phy-tegra194-p2u.c b/drivers/phy/tegra/phy-tegra194-p2u.c
> index 7042bed9feaa..42394d27f4cb 100644
> --- a/drivers/phy/tegra/phy-tegra194-p2u.c
> +++ b/drivers/phy/tegra/phy-tegra194-p2u.c
> @@ -92,10 +92,7 @@ static int tegra_p2u_probe(struct platform_device *pdev)
> phy_set_drvdata(generic_phy, phy);
>
> phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
> - if (IS_ERR(phy_provider))
> - return PTR_ERR(phy_provider);
> -
> - return 0;
> + return PTR_ERR_OR_ZERO(phy_provider);
> }
>
> static const struct of_device_id tegra_p2u_id_table[] = {
> --
> 2.17.1
>

\
 
 \ /
  Last update: 2020-05-06 13:49    [W:0.050 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site