drm: omapdrm: dss: simplify the return expression of hdmi_init_pll_data
Subsystems (3)
PATCH 1/1 drm: omapdrm: dss: simplify the return expression of hdmi_init_pll_data
Simplify the return expression.
--- drivers/gpu/drm/omapdrm/dss/hdmi_pll.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/omapdrm/dss/hdmi_pll.c +1 -6
@@ -131,7 +131,6 @@ static int hdmi_init_pll_data(struct dss_device *dss, {struct dss_pll *pll = &hpll->pll;struct clk *clk; -int r; clk =devm_clk_get (&pdev->dev,"sys_clk" );if (IS_ERR (clk)) {
@@ -151,11 +150,7 @@ static int hdmi_init_pll_data(struct dss_device *dss, pll->ops = &hdmi_pll_ops; - r =dss_pll_register (dss, pll); -if (r) -return r; - -return 0 ; +return dss_pll_register (dss, pll); } int hdmi_pll_init(struct dss_device *dss, struct platform_device *pdev,
Signature · 1 line
2.23.0
Hi,
Quoted 23 lines · Qinglang Miao
Simplify the return expression.
Signed-off-by Qinglang Miao <[email protected]>--- drivers/gpu/drm/omapdrm/dss/hdmi_pll.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)drivers/gpu/drm/omapdrm/dss/hdmi_pll.c +0
-1@@ -131,7 +131,6 @@ static int hdmi_init_pll_data(struct dss_device *dss, {struct dss_pll *pll = &hpll->pll;struct clk *clk; -int r; clk =devm_clk_get (&pdev->dev,"sys_clk" );if (IS_ERR (clk)) {@@ -151,11 +150,7 @@ static int hdmi_init_pll_data(struct dss_device *dss, pll->ops = &hdmi_pll_ops;
drivers/gpu/drm/omapdrm/dss/hdmi_pll.c static int hdmi_init_pll_data(struct dss_device *dss, · line 156
Quoted 10 lines
drivers/gpu/drm/omapdrm/dss/hdmi_pll.c +1
-5- r =dss_pll_register (dss, pll); -if (r) -return r; - -return 0 ; +return dss_pll_register (dss, pll); } int hdmi_pll_init(struct dss_device *dss, struct platform_device *pdev,
I like it more when there's a return 0 at the end of the function, especially in functions where there are multiple cases of if(...) return r. It's more easily readable, at least to my eyes.
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
Quoted 34 lines · Tomi Valkeinen
Hi,
Quoted 31 lines · Qinglang Miao
Simplify the return expression.
Signed-off-by Qinglang Miao <[email protected]>--- drivers/gpu/drm/omapdrm/dss/hdmi_pll.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)drivers/gpu/drm/omapdrm/dss/hdmi_pll.c +1
-6@@ -131,7 +131,6 @@ static int hdmi_init_pll_data(struct dss_device *dss, {struct dss_pll *pll = &hpll->pll;struct clk *clk; -int r; clk =devm_clk_get (&pdev->dev,"sys_clk" );if (IS_ERR (clk)) {@@ -151,11 +150,7 @@ static int hdmi_init_pll_data(struct dss_device *dss, pll->ops = &hdmi_pll_ops; - r =dss_pll_register (dss, pll); -if (r) -return r; - -return 0 ; +return dss_pll_register (dss, pll); }
Quoted 7 lines
drivers/gpu/drm/omapdrm/dss/hdmi_pll.c static int hdmi_init_pll_data(struct dss_device *dss, · line 156
Quoted 2 lines
drivers/gpu/drm/omapdrm/dss/hdmi_pll.c +0
-0int hdmi_pll_init(struct dss_device *dss, struct platform_device *pdev,I like it more when there's a return 0 at the end of the function, especially in functions where there are multiple cases of if(...) return r. It's more easily readable, at least to my eyes.
Tomi
Hi Tomi,
Glad to know your opnion and it sounds fine to me.
Thanks