* [PATCHv2 0/2] phy: Use PTR_ERR_OR_ZERO to replace the open coded version
@ 2018-08-16 15:58 zhong jiang
2018-08-16 15:58 ` [PATCHv2 1/2] phy:phy-brcm-usb: " zhong jiang
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: zhong jiang @ 2018-08-16 15:58 UTC (permalink / raw)
To: alcooperx, kishon, robh, hauke, ralf; +Cc: f.fainelli, linux-kernel
The issue is detected with the help of Coccinelle.
v1->v2:
- According to Florian's suggestion, change the subject of the patch.
zhong jiang (2):
phy:phy-brcm-usb: Use PTR_ERR_OR_ZERO to replace the open coded
version
phy:phy-lantiq-rcu-usb2: Use PTR_ERR_OR_ZERO to replace the open
coded version
drivers/phy/broadcom/phy-brcm-usb.c | 4 +---
drivers/phy/lantiq/phy-lantiq-rcu-usb2.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
--
1.7.12.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCHv2 1/2] phy:phy-brcm-usb: Use PTR_ERR_OR_ZERO to replace the open coded version
2018-08-16 15:58 [PATCHv2 0/2] phy: Use PTR_ERR_OR_ZERO to replace the open coded version zhong jiang
@ 2018-08-16 15:58 ` zhong jiang
2018-08-16 15:58 ` [PATCHv2 2/2] phy:phy-lantiq-rcu-usb2: " zhong jiang
2018-08-23 11:21 ` [PATCHv2 0/2] phy: " zhong jiang
2 siblings, 0 replies; 5+ messages in thread
From: zhong jiang @ 2018-08-16 15:58 UTC (permalink / raw)
To: alcooperx, kishon, robh, hauke, ralf; +Cc: f.fainelli, linux-kernel
PTR_ERR_OR_ZERO has implemented the if(IS_ERR(...)) + PTR_ERR, So
just replace them rather than duplicating its implement.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
drivers/phy/broadcom/phy-brcm-usb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/phy/broadcom/phy-brcm-usb.c b/drivers/phy/broadcom/phy-brcm-usb.c
index d1dab36..f59b1dc 100644
--- a/drivers/phy/broadcom/phy-brcm-usb.c
+++ b/drivers/phy/broadcom/phy-brcm-usb.c
@@ -372,10 +372,8 @@ static int brcm_usb_phy_probe(struct platform_device *pdev)
clk_disable(priv->usb_30_clk);
phy_provider = devm_of_phy_provider_register(dev, brcm_usb_phy_xlate);
- if (IS_ERR(phy_provider))
- return PTR_ERR(phy_provider);
- return 0;
+ return PTR_ERR_OR_ZERO(phy_provider);
}
#ifdef CONFIG_PM_SLEEP
--
1.7.12.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCHv2 2/2] phy:phy-lantiq-rcu-usb2: Use PTR_ERR_OR_ZERO to replace the open coded version
2018-08-16 15:58 [PATCHv2 0/2] phy: Use PTR_ERR_OR_ZERO to replace the open coded version zhong jiang
2018-08-16 15:58 ` [PATCHv2 1/2] phy:phy-brcm-usb: " zhong jiang
@ 2018-08-16 15:58 ` zhong jiang
2018-08-25 14:16 ` Hauke Mehrtens
2018-08-23 11:21 ` [PATCHv2 0/2] phy: " zhong jiang
2 siblings, 1 reply; 5+ messages in thread
From: zhong jiang @ 2018-08-16 15:58 UTC (permalink / raw)
To: alcooperx, kishon, robh, hauke, ralf; +Cc: f.fainelli, linux-kernel
PTR_ERR_OR_ZERO has implemented the if(IS_ERR(...)) + PTR_ERR, So
just replace them rather than duplicating its implement.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
drivers/phy/lantiq/phy-lantiq-rcu-usb2.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/phy/lantiq/phy-lantiq-rcu-usb2.c b/drivers/phy/lantiq/phy-lantiq-rcu-usb2.c
index 986224f..a918c5b 100644
--- a/drivers/phy/lantiq/phy-lantiq-rcu-usb2.c
+++ b/drivers/phy/lantiq/phy-lantiq-rcu-usb2.c
@@ -196,10 +196,8 @@ static int ltq_rcu_usb2_of_parse(struct ltq_rcu_usb2_priv *priv,
}
priv->phy_reset = devm_reset_control_get_optional(dev, "phy");
- if (IS_ERR(priv->phy_reset))
- return PTR_ERR(priv->phy_reset);
- return 0;
+ return PTR_ERR_OR_ZERO(priv->phy_reset);
}
static int ltq_rcu_usb2_phy_probe(struct platform_device *pdev)
--
1.7.12.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCHv2 0/2] phy: Use PTR_ERR_OR_ZERO to replace the open coded version
2018-08-16 15:58 [PATCHv2 0/2] phy: Use PTR_ERR_OR_ZERO to replace the open coded version zhong jiang
2018-08-16 15:58 ` [PATCHv2 1/2] phy:phy-brcm-usb: " zhong jiang
2018-08-16 15:58 ` [PATCHv2 2/2] phy:phy-lantiq-rcu-usb2: " zhong jiang
@ 2018-08-23 11:21 ` zhong jiang
2 siblings, 0 replies; 5+ messages in thread
From: zhong jiang @ 2018-08-23 11:21 UTC (permalink / raw)
To: alcooperx, kishon, robh, hauke, ralf; +Cc: f.fainelli, linux-kernel
Ping , Anyone has any objection with the patchset ?
Thanks,
zhong jiang
On 2018/8/16 23:58, zhong jiang wrote:
> The issue is detected with the help of Coccinelle.
>
> v1->v2:
> - According to Florian's suggestion, change the subject of the patch.
>
> zhong jiang (2):
> phy:phy-brcm-usb: Use PTR_ERR_OR_ZERO to replace the open coded
> version
> phy:phy-lantiq-rcu-usb2: Use PTR_ERR_OR_ZERO to replace the open
> coded version
>
> drivers/phy/broadcom/phy-brcm-usb.c | 4 +---
> drivers/phy/lantiq/phy-lantiq-rcu-usb2.c | 4 +---
> 2 files changed, 2 insertions(+), 6 deletions(-)
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCHv2 2/2] phy:phy-lantiq-rcu-usb2: Use PTR_ERR_OR_ZERO to replace the open coded version
2018-08-16 15:58 ` [PATCHv2 2/2] phy:phy-lantiq-rcu-usb2: " zhong jiang
@ 2018-08-25 14:16 ` Hauke Mehrtens
0 siblings, 0 replies; 5+ messages in thread
From: Hauke Mehrtens @ 2018-08-25 14:16 UTC (permalink / raw)
To: zhong jiang, alcooperx, kishon, robh, ralf; +Cc: f.fainelli, linux-kernel
On 08/16/2018 05:58 PM, zhong jiang wrote:
> PTR_ERR_OR_ZERO has implemented the if(IS_ERR(...)) + PTR_ERR, So
> just replace them rather than duplicating its implement.
>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
> drivers/phy/lantiq/phy-lantiq-rcu-usb2.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/phy/lantiq/phy-lantiq-rcu-usb2.c b/drivers/phy/lantiq/phy-lantiq-rcu-usb2.c
> index 986224f..a918c5b 100644
> --- a/drivers/phy/lantiq/phy-lantiq-rcu-usb2.c
> +++ b/drivers/phy/lantiq/phy-lantiq-rcu-usb2.c
> @@ -196,10 +196,8 @@ static int ltq_rcu_usb2_of_parse(struct ltq_rcu_usb2_priv *priv,
> }
>
> priv->phy_reset = devm_reset_control_get_optional(dev, "phy");
> - if (IS_ERR(priv->phy_reset))
> - return PTR_ERR(priv->phy_reset);
>
> - return 0;
> + return PTR_ERR_OR_ZERO(priv->phy_reset);
> }
>
> static int ltq_rcu_usb2_phy_probe(struct platform_device *pdev)
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-08-25 14:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-16 15:58 [PATCHv2 0/2] phy: Use PTR_ERR_OR_ZERO to replace the open coded version zhong jiang
2018-08-16 15:58 ` [PATCHv2 1/2] phy:phy-brcm-usb: " zhong jiang
2018-08-16 15:58 ` [PATCHv2 2/2] phy:phy-lantiq-rcu-usb2: " zhong jiang
2018-08-25 14:16 ` Hauke Mehrtens
2018-08-23 11:21 ` [PATCHv2 0/2] phy: " zhong jiang
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).