diff mbox

[1/1] ARM: imx: use PTR_ERR_OR_ZERO

Message ID 1404500590-21712-1-git-send-email-fabf@skynet.be
State New
Headers show

Commit Message

Fabian Frederick July 4, 2014, 7:03 p.m. UTC
replace IS_ERR/PTR_ERR

Cc: Shawn Guo <shawn.guo@freescale.com>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---

This is untested.

 arch/arm/mach-imx/devices/platform-mxc_rnga.c | 5 +----
 arch/arm/mach-imx/mach-mx31moboard.c          | 4 +---
 arch/arm/mach-imx/mx31moboard-devboard.c      | 4 +---
 arch/arm/mach-imx/mx31moboard-marxbot.c       | 4 +---
 arch/arm/mach-imx/mx31moboard-smartbot.c      | 4 +---
 5 files changed, 5 insertions(+), 16 deletions(-)

Comments

Shawn Guo July 7, 2014, 5:55 a.m. UTC | #1
On Fri, Jul 04, 2014 at 09:03:10PM +0200, Fabian Frederick wrote:
> replace IS_ERR/PTR_ERR
> 
> Cc: Shawn Guo <shawn.guo@freescale.com>
> Cc: Sascha Hauer <kernel@pengutronix.de>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Fabian Frederick <fabf@skynet.be>

Applied, thanks.
Sachin Kamat July 8, 2014, 3:48 a.m. UTC | #2
Hi Shawn,

On Mon, Jul 7, 2014 at 11:25 AM, Shawn Guo <shawn.guo@freescale.com> wrote:
> On Fri, Jul 04, 2014 at 09:03:10PM +0200, Fabian Frederick wrote:
>> replace IS_ERR/PTR_ERR
>>
>> Cc: Shawn Guo <shawn.guo@freescale.com>
>> Cc: Sascha Hauer <kernel@pengutronix.de>
>> Cc: linux-arm-kernel@lists.infradead.org
>> Signed-off-by: Fabian Frederick <fabf@skynet.be>
>
> Applied, thanks.


I had sent a similar series [1] in May which you rejected. Just
curious if something
changed between then and now?

[1] http://patchwork.ozlabs.org/patch/353653/
Fabian Frederick July 8, 2014, 5:08 a.m. UTC | #3
On Tue, 8 Jul 2014 09:18:56 +0530
Sachin Kamat <spk.linux@gmail.com> wrote:

> Hi Shawn,
> 
> On Mon, Jul 7, 2014 at 11:25 AM, Shawn Guo <shawn.guo@freescale.com> wrote:
> > On Fri, Jul 04, 2014 at 09:03:10PM +0200, Fabian Frederick wrote:
> >> replace IS_ERR/PTR_ERR
> >>
> >> Cc: Shawn Guo <shawn.guo@freescale.com>
> >> Cc: Sascha Hauer <kernel@pengutronix.de>
> >> Cc: linux-arm-kernel@lists.infradead.org
> >> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> >
> > Applied, thanks.
> 
> 
> I had sent a similar series [1] in May which you rejected. Just
> curious if something
> changed between then and now?

Hi Sachin,

	I still don't see anything from you for those files in linux-next lately.
If it was already in some other tree, you can remove my patch or update signed-off-by as it seems
you made it before me :)
 
Regards,
Fabian

> 
> [1] http://patchwork.ozlabs.org/patch/353653/
> 
> -- 
> Regards,
> Sachin.
Shawn Guo July 8, 2014, 5:19 a.m. UTC | #4
On Tue, Jul 08, 2014 at 09:18:56AM +0530, Sachin Kamat wrote:
> Hi Shawn,
> 
> On Mon, Jul 7, 2014 at 11:25 AM, Shawn Guo <shawn.guo@freescale.com> wrote:
> > On Fri, Jul 04, 2014 at 09:03:10PM +0200, Fabian Frederick wrote:
> >> replace IS_ERR/PTR_ERR
> >>
> >> Cc: Shawn Guo <shawn.guo@freescale.com>
> >> Cc: Sascha Hauer <kernel@pengutronix.de>
> >> Cc: linux-arm-kernel@lists.infradead.org
> >> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> >
> > Applied, thanks.
> 
> 
> I had sent a similar series [1] in May which you rejected. Just
> curious if something
> changed between then and now?

The main difference is this is the second attempt from a different
person to "clean up" the code.  I'm still not fond of the change, but
I'm getting tied to tell people about that, so just applied the change,
since after all it at least gives some good diffstat.

I would prefer Fabian's patch over yours because it's really good
enough to have one patch than 5 patches in a series to do the change for
IMX platform.

Shawn
Sachin Kamat July 8, 2014, 6:19 a.m. UTC | #5
On Tue, Jul 8, 2014 at 10:49 AM, Shawn Guo <shawn.guo@freescale.com> wrote:
> On Tue, Jul 08, 2014 at 09:18:56AM +0530, Sachin Kamat wrote:
>> Hi Shawn,
>>
>> On Mon, Jul 7, 2014 at 11:25 AM, Shawn Guo <shawn.guo@freescale.com> wrote:
>> > On Fri, Jul 04, 2014 at 09:03:10PM +0200, Fabian Frederick wrote:
>> >> replace IS_ERR/PTR_ERR
>> >>
>> >> Cc: Shawn Guo <shawn.guo@freescale.com>
>> >> Cc: Sascha Hauer <kernel@pengutronix.de>
>> >> Cc: linux-arm-kernel@lists.infradead.org
>> >> Signed-off-by: Fabian Frederick <fabf@skynet.be>
>> >
>> > Applied, thanks.
>>
>>
>> I had sent a similar series [1] in May which you rejected. Just
>> curious if something
>> changed between then and now?
>
> The main difference is this is the second attempt from a different
> person to "clean up" the code.  I'm still not fond of the change, but
> I'm getting tied to tell people about that, so just applied the change,
> since after all it at least gives some good diffstat.
>
> I would prefer Fabian's patch over yours because it's really good
> enough to have one patch than 5 patches in a series to do the change for
> IMX platform.

Doesn't really matter whose patches are in. I was just curious to know
the change
in logic at this point of time. Thanks for clarification.
diff mbox

Patch

diff --git a/arch/arm/mach-imx/devices/platform-mxc_rnga.c b/arch/arm/mach-imx/devices/platform-mxc_rnga.c
index c58404b..851fbc8a 100644
--- a/arch/arm/mach-imx/devices/platform-mxc_rnga.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_rnga.c
@@ -48,9 +48,6 @@  static int __init imxXX_add_mxc_rnga(void)
 #endif /* if defined(CONFIG_SOC_IMX31) */
 		ret = ERR_PTR(-ENODEV);
 
-	if (IS_ERR(ret))
-		return PTR_ERR(ret);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(ret);
 }
 arch_initcall(imxXX_add_mxc_rnga);
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c
index 08730f2..7839efa 100644
--- a/arch/arm/mach-imx/mach-mx31moboard.c
+++ b/arch/arm/mach-imx/mach-mx31moboard.c
@@ -434,10 +434,8 @@  static int __init moboard_usbh2_init(void)
 		return -ENODEV;
 
 	pdev = imx31_add_mxc_ehci_hs(2, &usbh2_pdata);
-	if (IS_ERR(pdev))
-		return PTR_ERR(pdev);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(pdev);
 }
 
 static const struct gpio_led mx31moboard_leds[] __initconst = {
diff --git a/arch/arm/mach-imx/mx31moboard-devboard.c b/arch/arm/mach-imx/mx31moboard-devboard.c
index 52d5b15..0636369 100644
--- a/arch/arm/mach-imx/mx31moboard-devboard.c
+++ b/arch/arm/mach-imx/mx31moboard-devboard.c
@@ -213,10 +213,8 @@  static int __init devboard_usbh1_init(void)
 	usbh1_pdata.otg = phy;
 
 	pdev = imx31_add_mxc_ehci_hs(1, &usbh1_pdata);
-	if (IS_ERR(pdev))
-		return PTR_ERR(pdev);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(pdev);
 }
 
 
diff --git a/arch/arm/mach-imx/mx31moboard-marxbot.c b/arch/arm/mach-imx/mx31moboard-marxbot.c
index a4f43e9..b38d6d8 100644
--- a/arch/arm/mach-imx/mx31moboard-marxbot.c
+++ b/arch/arm/mach-imx/mx31moboard-marxbot.c
@@ -327,10 +327,8 @@  static int __init marxbot_usbh1_init(void)
 	usbh1_pdata.otg = phy;
 
 	pdev = imx31_add_mxc_ehci_hs(1, &usbh1_pdata);
-	if (IS_ERR(pdev))
-		return PTR_ERR(pdev);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(pdev);
 }
 
 static const struct fsl_usb2_platform_data usb_pdata __initconst = {
diff --git a/arch/arm/mach-imx/mx31moboard-smartbot.c b/arch/arm/mach-imx/mx31moboard-smartbot.c
index 04ae45d..0c6ac75 100644
--- a/arch/arm/mach-imx/mx31moboard-smartbot.c
+++ b/arch/arm/mach-imx/mx31moboard-smartbot.c
@@ -141,10 +141,8 @@  static int __init smartbot_otg_host_init(void)
 		return -ENODEV;
 
 	pdev = imx31_add_mxc_ehci_otg(&otg_host_pdata);
-	if (IS_ERR(pdev))
-		return PTR_ERR(pdev);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(pdev);
 }
 #else
 static inline int smartbot_otg_host_init(void) { return 0; }