lkml.org 
[lkml]   [2020]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Intel: Skylake: Fix inconsistent IS_ERR and PTR_ERR
From
Date
On Fri, 2020-02-21 at 18:11 +0800, Xu Wang wrote:
> PTR_ERR should access the value just tested by IS_ERR.
> In skl_clk_dev_probe(),it is inconsistent.
[]
> diff --git a/sound/soc/intel/skylake/skl-ssp-clk.c b/sound/soc/intel/skylake/skl-ssp-clk.c
[]
> @@ -384,7 +384,7 @@ static int skl_clk_dev_probe(struct platform_device *pdev)
> &clks[i], clk_pdata, i);
>
> if (IS_ERR(data->clk[data->avail_clk_cnt])) {
> - ret = PTR_ERR(data->clk[data->avail_clk_cnt++]);
> + ret = PTR_ERR(data->clk[data->avail_clk_cnt]);

NAK.

This is not inconsistent and you are removing the ++
which is a post increment. Likely that is necessary.

You could write the access and the increment as two
separate statements if it confuses you.


\
 
 \ /
  Last update: 2020-02-21 15:43    [W:0.070 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site