[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <567d4fcd-6e02-d80e-33cb-3a6810bf833a@huawei.com>
Date: Mon, 17 May 2021 09:19:05 +0800
From: Chao Yu <yuchao0@...wei.com>
To: <trix@...hat.com>, <jaegeuk@...nel.org>, <chao@...nel.org>
CC: <linux-kernel@...r.kernel.org>,
<linux-f2fs-devel@...ts.sourceforge.net>
Subject: Re: [f2fs-dev] [PATCH] f2fs: return success if there is no work to do
On 2021/5/16 2:09, trix@...hat.com wrote:
> From: Tom Rix <trix@...hat.com>
>
> Static analysis reports this problem
> file.c:3206:2: warning: Undefined or garbage value returned to caller
> return err;
> ^~~~~~~~~~
>
> err is only set if there is some work to do. Because the loop returns
> immediately on an error, if all the work was done, a 0 would be returned.
> Instead of checking the unlikely case that there was no work to do,
> change the return of err to 0.
>
> Signed-off-by: Tom Rix <trix@...hat.com>
Reviewed-by: Chao Yu <yuchao0@...wei.com>
Thanks,
Powered by blists - more mailing lists