[linux-yocto] [PATCH] aufs: fix compile warning
Bruce Ashfield
bruce.ashfield at windriver.com
Thu Mar 1 20:03:24 PST 2018
Looks good. I've added this to my queue, but I'm working through
a kernel-devsrc change and libc-headers update, so it will be a
few days before I can get it merged.
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