在 2020/9/21 21:39, Tomi Valkeinen 写道:
Hi,

On 21/09/2020 16:10, Qinglang Miao wrote:
Simplify the return expression.

Signed-off-by: Qinglang Miao <miaoqingl...@huawei.com>
---
  drivers/gpu/drm/omapdrm/dss/hdmi_pll.c | 7 +------
  1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi_pll.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi_pll.c
index cf2b000f3..c3e85b636 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi_pll.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi_pll.c
@@ -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,


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


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to