[linux-yocto] [PATCH] aufs: fix compile warning

Bruce Ashfield bruce.ashfield at windriver.com
Mon Dec 5 12:58:09 PST 2016


merged.

Bruce

On 2016-11-29 05:14 PM, Kexin(Casey) Chen wrote:
> fs/aufs/debug.h:95:19: warning: comparison of constant '0'
> with boolean expression is always false [-Wbool-compare]
>    if (unlikely((e) < 0)) \
>                     ^
>
> fs/aufs/vdir.c:852:2: note: in expansion of macro 'AuTraceErr'
>    AuTraceErr(!valid);
>    ^~~~~~~~~~
>
> In expansion of AuTraceErr(!valid), comparison of (!valid)
> and constant '0' always passes unlikely(x) false. function
> 'static int seek_vdir(struct file *file, struct dir_context *ctx)'
> is to find whether there is a valid vd_deblk following ctx->pos.
> return 1 means valid, 0 for not. Change to AuTraceErr(valid - 1)
> makes more sense.
>
> Signed-off-by: Kexin(Casey) Chen <Casey.Chen at windriver.com>
> ---
>  fs/aufs/vdir.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/aufs/vdir.c b/fs/aufs/vdir.c
> index 1ca6760f4016..9a087ce6dc15 100644
> --- a/fs/aufs/vdir.c
> +++ b/fs/aufs/vdir.c
> @@ -849,7 +849,7 @@ static int seek_vdir(struct file *file, struct dir_context *ctx)
>
>  out:
>  	/* smp_mb(); */
> -	AuTraceErr(!valid);
> +	AuTraceErr(valid - 1);
>  	return valid;
>  }
>
>



More information about the linux-yocto mailing list