2014-07-04 19:03:15

by Fabian Frédérick

[permalink] [raw]
Subject: [PATCH 1/1] ARM: imx: use PTR_ERR_OR_ZERO

replace IS_ERR/PTR_ERR

Cc: Shawn Guo <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: [email protected]
Signed-off-by: Fabian Frederick <[email protected]>
---

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(-)

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; }
--
1.9.1


2014-07-07 05:55:33

by Shawn Guo

[permalink] [raw]
Subject: Re: [PATCH 1/1] ARM: imx: use PTR_ERR_OR_ZERO

On Fri, Jul 04, 2014 at 09:03:10PM +0200, Fabian Frederick wrote:
> replace IS_ERR/PTR_ERR
>
> Cc: Shawn Guo <[email protected]>
> Cc: Sascha Hauer <[email protected]>
> Cc: [email protected]
> Signed-off-by: Fabian Frederick <[email protected]>

Applied, thanks.

2014-07-08 03:48:59

by Sachin Kamat

[permalink] [raw]
Subject: Re: [PATCH 1/1] ARM: imx: use PTR_ERR_OR_ZERO

Hi Shawn,

On Mon, Jul 7, 2014 at 11:25 AM, Shawn Guo <[email protected]> wrote:
> On Fri, Jul 04, 2014 at 09:03:10PM +0200, Fabian Frederick wrote:
>> replace IS_ERR/PTR_ERR
>>
>> Cc: Shawn Guo <[email protected]>
>> Cc: Sascha Hauer <[email protected]>
>> Cc: [email protected]
>> Signed-off-by: Fabian Frederick <[email protected]>
>
> 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/

--
Regards,
Sachin.

2014-07-08 05:07:51

by Fabian Frédérick

[permalink] [raw]
Subject: Re: [PATCH 1/1] ARM: imx: use PTR_ERR_OR_ZERO

On Tue, 8 Jul 2014 09:18:56 +0530
Sachin Kamat <[email protected]> wrote:

> Hi Shawn,
>
> On Mon, Jul 7, 2014 at 11:25 AM, Shawn Guo <[email protected]> wrote:
> > On Fri, Jul 04, 2014 at 09:03:10PM +0200, Fabian Frederick wrote:
> >> replace IS_ERR/PTR_ERR
> >>
> >> Cc: Shawn Guo <[email protected]>
> >> Cc: Sascha Hauer <[email protected]>
> >> Cc: [email protected]
> >> Signed-off-by: Fabian Frederick <[email protected]>
> >
> > 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.

2014-07-08 05:19:31

by Shawn Guo

[permalink] [raw]
Subject: Re: [PATCH 1/1] ARM: imx: use PTR_ERR_OR_ZERO

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 <[email protected]> wrote:
> > On Fri, Jul 04, 2014 at 09:03:10PM +0200, Fabian Frederick wrote:
> >> replace IS_ERR/PTR_ERR
> >>
> >> Cc: Shawn Guo <[email protected]>
> >> Cc: Sascha Hauer <[email protected]>
> >> Cc: [email protected]
> >> Signed-off-by: Fabian Frederick <[email protected]>
> >
> > 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

2014-07-08 06:19:12

by Sachin Kamat

[permalink] [raw]
Subject: Re: [PATCH 1/1] ARM: imx: use PTR_ERR_OR_ZERO

On Tue, Jul 8, 2014 at 10:49 AM, Shawn Guo <[email protected]> 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 <[email protected]> wrote:
>> > On Fri, Jul 04, 2014 at 09:03:10PM +0200, Fabian Frederick wrote:
>> >> replace IS_ERR/PTR_ERR
>> >>
>> >> Cc: Shawn Guo <[email protected]>
>> >> Cc: Sascha Hauer <[email protected]>
>> >> Cc: [email protected]
>> >> Signed-off-by: Fabian Frederick <[email protected]>
>> >
>> > 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.

--
Regards,
Sachin.