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

Bruce Ashfield bruce.ashfield at windriver.com
Mon Mar 5 11:55:55 PST 2018


This is now merged.

Given the description, I merged it to 4.12, 4.14 and 4.15. If
the 4.14/4.15 merge is invalid, let me know so I can revert.

Bruce

On 2018-02-28 8:44 PM, Dengke Du wrote:
> From: "Kexin(Casey) Chen" <Casey.Chen at windriver.com>
> 
> Forward port linux-yocto-4.8's patch to fix the build warning.
> 
>      http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-4.8/commit/?h=standard/base&id=7e0dd2f2b0971f0e3191e1ddc088e09eb9855567
> 
> 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>
> Signed-off-by: Dengke Du <dengke.du 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 b7583e9..15f0106 100644
> --- a/fs/aufs/vdir.c
> +++ b/fs/aufs/vdir.c
> @@ -841,7 +841,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