2019-03-29 01:31:04

by Yue Haibing

[permalink] [raw]
Subject: [PATCH -next] drm/omap: Use PTR_ERR_OR_ZERO in hdmi4_core_init()

Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Signed-off-by: YueHaibing <[email protected]>
---
drivers/gpu/drm/omapdrm/dss/hdmi4_core.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
index e384b95ad857..8287ade5ece0 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
@@ -934,8 +934,5 @@ int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core)

res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core");
core->base = devm_ioremap_resource(&pdev->dev, res);
- if (IS_ERR(core->base))
- return PTR_ERR(core->base);
-
- return 0;
+ return PTR_ERR_OR_ZERO(core->base);
}







2019-03-29 02:06:38

by Matteo Croce

[permalink] [raw]
Subject: Re: [PATCH -next] drm/omap: Use PTR_ERR_OR_ZERO in hdmi4_core_init()

On Fri, Mar 29, 2019 at 2:30 AM YueHaibing <[email protected]> wrote:
>
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
>
> Signed-off-by: YueHaibing <[email protected]>
> ---
> drivers/gpu/drm/omapdrm/dss/hdmi4_core.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>

Acked-by: Matteo Croce <[email protected]>

--
Matteo Croce
per aspera ad upstream

2019-03-29 06:58:18

by Mukesh Ojha

[permalink] [raw]
Subject: Re: [PATCH -next] drm/omap: Use PTR_ERR_OR_ZERO in hdmi4_core_init()


On 3/29/2019 7:11 AM, YueHaibing wrote:
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
>
> Signed-off-by: YueHaibing <[email protected]>


Reviewed-by: Mukesh Ojha <[email protected]>

-Mukesh

> ---
> drivers/gpu/drm/omapdrm/dss/hdmi4_core.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
> index e384b95ad857..8287ade5ece0 100644
> --- a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
> +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
> @@ -934,8 +934,5 @@ int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core)
>
> res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core");
> core->base = devm_ioremap_resource(&pdev->dev, res);
> - if (IS_ERR(core->base))
> - return PTR_ERR(core->base);
> -
> - return 0;
> + return PTR_ERR_OR_ZERO(core->base);
> }



>
>
>
>
>

2019-04-01 10:24:15

by Tomi Valkeinen

[permalink] [raw]
Subject: Re: [PATCH -next] drm/omap: Use PTR_ERR_OR_ZERO in hdmi4_core_init()

Hi,

On 29/03/2019 03:41, YueHaibing wrote:
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
>
> Signed-off-by: YueHaibing <[email protected]>
> ---
> drivers/gpu/drm/omapdrm/dss/hdmi4_core.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
> index e384b95ad857..8287ade5ece0 100644
> --- a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
> +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
> @@ -934,8 +934,5 @@ int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core)
>
> res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core");
> core->base = devm_ioremap_resource(&pdev->dev, res);
> - if (IS_ERR(core->base))
> - return PTR_ERR(core->base);
> -
> - return 0;
> + return PTR_ERR_OR_ZERO(core->base);
> }

Thanks, but I don't usually want this kind of patches. They're mostly
just extra changes, increasing the chance of conflicts, and, in my
opinion, the current code is clearer than the proposed one.

Tomi

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki