lkml.org 
[lkml]   [2021]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [f2fs-dev] [PATCH] f2fs: return success if there is no work to do
From
Date
On 2021/5/16 2:09, trix@redhat.com wrote:
> From: Tom Rix <trix@redhat.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@redhat.com>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

\
 
 \ /
  Last update: 2021-05-17 03:19    [W:0.040 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site