drm/omap: dss: Use PTR_ERR_OR_ZERO() to simplify code
Subsystems (3)
cover drm/omap: dss: Use PTR_ERR_OR_ZERO() to simplify code
zhengbin (4):
drm/omap: dss: Use PTR_ERR_OR_ZERO() to simplify code in
hdmi_audio_register
drm/omap: dss: Use PTR_ERR_OR_ZERO() to simplify code in
hdmi4_core_init
drm/omap: dss: Use PTR_ERR_OR_ZERO() to simplify code in
hdmi5_core_init
drm/omap: dss: Use PTR_ERR_OR_ZERO() to simplify code in hdmi_phy_init
drivers/gpu/drm/omapdrm/dss/hdmi4.c | 5 +---- drivers/gpu/drm/omapdrm/dss/hdmi4_core.c | 5 +---- drivers/gpu/drm/omapdrm/dss/hdmi5_core.c | 5 +---- drivers/gpu/drm/omapdrm/dss/hdmi_phy.c | 5 +---- 4 files changed, 4 insertions(+), 16 deletions(-)
--
2.7.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/4 drm/omap: dss: Use PTR_ERR_OR_ZERO() to simplify code in hdmi_audio_register
Fixes coccicheck warning:
drivers/gpu/drm/omapdrm/dss/hdmi4.c:590:1-3: WARNING: PTR_ERR_OR_ZERO can be used
--- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/omapdrm/dss/hdmi4.c +1 -4
@@ -587,10 +587,7 @@ static int hdmi_audio_register(struct omap_hdmi *hdmi) &hdmi->pdev->dev,"omap-hdmi-audio" ,PLATFORM_DEVID_AUTO , &pdata, sizeof(pdata)); -if (IS_ERR (hdmi->audio_pdev)) -return PTR_ERR (hdmi->audio_pdev); - -return 0 ; +return PTR_ERR_OR_ZERO (hdmi->audio_pdev); }/* -----------------------------------------------------------------------------
--
2.7.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/4 drm/omap: dss: Use PTR_ERR_OR_ZERO() to simplify code in hdmi4_core_init
In reply to zhengbinFixes coccicheck warning:
drivers/gpu/drm/omapdrm/dss/hdmi4_core.c:927:1-3: WARNING: PTR_ERR_OR_ZERO can be used
--- drivers/gpu/drm/omapdrm/dss/hdmi4_core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/omapdrm/dss/hdmi4_core.c +1 -4
@@ -924,8 +924,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); }
--
2.7.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/4 drm/omap: dss: Use PTR_ERR_OR_ZERO() to simplify code in hdmi5_core_init
In reply to zhengbinFixes coccicheck warning:
drivers/gpu/drm/omapdrm/dss/hdmi5_core.c:911:1-3: WARNING: PTR_ERR_OR_ZERO can be used
--- drivers/gpu/drm/omapdrm/dss/hdmi5_core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/omapdrm/dss/hdmi5_core.c +1 -4
@@ -908,8 +908,5 @@ int hdmi5_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); }
--
2.7.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 4/4 drm/omap: dss: Use PTR_ERR_OR_ZERO() to simplify code in hdmi_phy_init
In reply to zhengbinFixes coccicheck warning:
drivers/gpu/drm/omapdrm/dss/hdmi_phy.c:194:1-3: WARNING: PTR_ERR_OR_ZERO can be used
--- drivers/gpu/drm/omapdrm/dss/hdmi_phy.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/omapdrm/dss/hdmi_phy.c +1 -4
@@ -191,8 +191,5 @@ int hdmi_phy_init(struct platform_device *pdev, struct hdmi_phy_data *phy, res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"phy" ); phy->base =devm_ioremap_resource (&pdev->dev, res); -if (IS_ERR (phy->base)) -return PTR_ERR (phy->base); - -return 0 ; +return PTR_ERR_OR_ZERO (phy->base); }
--
2.7.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi zhengbin,
Quoted 9 lines · zhengbin
zhengbin (4):
drm/omap: dss: UsePTR_ERR_OR_ZERO()to simplify code in
hdmi_audio_register
drm/omap: dss: UsePTR_ERR_OR_ZERO()to simplify code in
hdmi4_core_init
drm/omap: dss: UsePTR_ERR_OR_ZERO()to simplify code in
hdmi5_core_init
drm/omap: dss: UsePTR_ERR_OR_ZERO()to simplify code inhdmi_phy_init
Quoted 5 lines
drivers/gpu/drm/omapdrm/dss/hdmi4.c | 5 +---- drivers/gpu/drm/omapdrm/dss/hdmi4_core.c | 5 +---- drivers/gpu/drm/omapdrm/dss/hdmi5_core.c | 5 +---- drivers/gpu/drm/omapdrm/dss/hdmi_phy.c | 5 +---- 4 files changed, 4 insertions(+), 16 deletions(-)
Thanks, but I don't like PTR_ERR_OR_ZERO, I think it makes the code more difficult to read and manage.
Tomi
Signature · 6 lines
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel