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

Kexin(Casey) Chen Casey.Chen at windriver.com
Tue Nov 29 14:14:13 PST 2016


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;
 }
 
-- 
2.11.0.rc2.dirty



More information about the linux-yocto mailing list