All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Staging: usb: Use PTR_ERR_OR_ZERO instead of if(IS_ERR(...)) + PTR_ERR.
@ 2016-02-27 11:26 Sandhya Bankar
  2016-02-27 19:36 ` [Outreachy kernel] " Julia Lawall
  2016-02-28  9:09 ` sandhya bankar
  0 siblings, 2 replies; 3+ messages in thread
From: Sandhya Bankar @ 2016-02-27 11:26 UTC (permalink / raw)
  To: outreachy-kernel

Use PTR_ERR_OR_ZERO instead of if(IS_ERR(...)) + PTR_ERR.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
---
 drivers/usb/phy/phy-qcom-8x16-usb.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/usb/phy/phy-qcom-8x16-usb.c b/drivers/usb/phy/phy-qcom-8x16-usb.c
index 579587d..dc97abe 100644
--- a/drivers/usb/phy/phy-qcom-8x16-usb.c
+++ b/drivers/usb/phy/phy-qcom-8x16-usb.c
@@ -291,10 +291,7 @@ static int phy_8x16_read_devicetree(struct phy_8x16 *qphy)
 
 	qphy->switch_gpio = devm_gpiod_get_optional(dev, "switch",
 						   GPIOD_OUT_LOW);
-	if (IS_ERR(qphy->switch_gpio))
-		return PTR_ERR(qphy->switch_gpio);
-
-	return 0;
+	PTR_ERR_OR_ZERO(qphy->switch_gpio);
 }
 
 static int phy_8x16_reboot_notify(struct notifier_block *this,
-- 
1.8.3.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Outreachy kernel] [PATCH 1/2] Staging: usb: Use PTR_ERR_OR_ZERO instead of if(IS_ERR(...)) + PTR_ERR.
  2016-02-27 11:26 [PATCH 1/2] Staging: usb: Use PTR_ERR_OR_ZERO instead of if(IS_ERR(...)) + PTR_ERR Sandhya Bankar
@ 2016-02-27 19:36 ` Julia Lawall
  2016-02-28  9:09 ` sandhya bankar
  1 sibling, 0 replies; 3+ messages in thread
From: Julia Lawall @ 2016-02-27 19:36 UTC (permalink / raw)
  To: Sandhya Bankar; +Cc: outreachy-kernel

On Sat, 27 Feb 2016, Sandhya Bankar wrote:

> Use PTR_ERR_OR_ZERO instead of if(IS_ERR(...)) + PTR_ERR.
> 
> Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
> ---
>  drivers/usb/phy/phy-qcom-8x16-usb.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/phy/phy-qcom-8x16-usb.c b/drivers/usb/phy/phy-qcom-8x16-usb.c
> index 579587d..dc97abe 100644
> --- a/drivers/usb/phy/phy-qcom-8x16-usb.c
> +++ b/drivers/usb/phy/phy-qcom-8x16-usb.c
> @@ -291,10 +291,7 @@ static int phy_8x16_read_devicetree(struct phy_8x16 *qphy)
>  
>  	qphy->switch_gpio = devm_gpiod_get_optional(dev, "switch",
>  						   GPIOD_OUT_LOW);
> -	if (IS_ERR(qphy->switch_gpio))
> -		return PTR_ERR(qphy->switch_gpio);
> -
> -	return 0;
> +	PTR_ERR_OR_ZERO(qphy->switch_gpio);

You still need the return.

julia


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] Staging: usb: Use PTR_ERR_OR_ZERO instead of if(IS_ERR(...)) + PTR_ERR.
  2016-02-27 11:26 [PATCH 1/2] Staging: usb: Use PTR_ERR_OR_ZERO instead of if(IS_ERR(...)) + PTR_ERR Sandhya Bankar
  2016-02-27 19:36 ` [Outreachy kernel] " Julia Lawall
@ 2016-02-28  9:09 ` sandhya bankar
  1 sibling, 0 replies; 3+ messages in thread
From: sandhya bankar @ 2016-02-28  9:09 UTC (permalink / raw)
  To: outreachy-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1096 bytes --]


Please ignore this patchset. I was not in  driver/staging.


On Sunday, February 28, 2016 at 12:56:39 AM UTC+5:30, sandhya bankar wrote:
>
> Use PTR_ERR_OR_ZERO instead of if(IS_ERR(...)) + PTR_ERR. 
>
> Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> 
> --- 
>  drivers/usb/phy/phy-qcom-8x16-usb.c | 5 +---- t
>  1 file changed, 1 insertion(+), 4 deletions(-) 
>
> diff --git a/drivers/usb/phy/phy-qcom-8x16-usb.c 
> b/drivers/usb/phy/phy-qcom-8x16-usb.c 
> index 579587d..dc97abe 100644 
> --- a/drivers/usb/phy/phy-qcom-8x16-usb.c 
> +++ b/drivers/usb/phy/phy-qcom-8x16-usb.c 
> @@ -291,10 +291,7 @@ static int phy_8x16_read_devicetree(struct phy_8x16 
> *qphy) 
>   
>          qphy->switch_gpio = devm_gpiod_get_optional(dev, "switch", 
>                                                     GPIOD_OUT_LOW); 
> -        if (IS_ERR(qphy->switch_gpio)) 
> -                return PTR_ERR(qphy->switch_gpio); 
> - 
> -        return 0; 
> +        PTR_ERR_OR_ZERO(qphy->switch_gpio); 
>  } 
>   
>  static int phy_8x16_reboot_notify(struct notifier_block *this, 
> -- 
> 1.8.3.4 
>
>

[-- Attachment #1.2: Type: text/html, Size: 1718 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-28  9:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-27 11:26 [PATCH 1/2] Staging: usb: Use PTR_ERR_OR_ZERO instead of if(IS_ERR(...)) + PTR_ERR Sandhya Bankar
2016-02-27 19:36 ` [Outreachy kernel] " Julia Lawall
2016-02-28  9:09 ` sandhya bankar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.