Re: [vserver] Kernel compile warnings

From: Ghislain Adnet <gadnet_at_aqueos.com>
Date: Fri 29 Dec 2017 - 08:06:08 GMT
Message-ID: <1802de69-aebd-103f-54d5-50ad0b079f2b@aqueos.com>

Hi,

Will this patch :

-------------------------------------------------------

--- /vservers/kernel/linux-4.1.46/kernel/vserver/proc.c 2017-11-15 13:58:57.568589199 +0100
+++ /vservers/kernel/linux-4.1.48/kernel/vserver/proc.c 2017-12-28 18:36:05.386565789 +0100
@@ -617,13 +617,13 @@
        switch (ctx->pos) {
        case 0:
                ino = inode->i_ino;
- if (!dir_emit(ctx, ".", 1, ino, DT_DIR) < 0)
+ if ( dir_emit(ctx, ".", 1, ino, DT_DIR) )
                        goto out;
                ctx->pos++;
                /* fall through */
        case 1:
                ino = parent_ino(dentry);
- if (!dir_emit(ctx, "..", 2, ino, DT_DIR) < 0)
+ if (dir_emit(ctx, "..", 2, ino, DT_DIR))
                        goto out;
                ctx->pos++;
                /* fall through */
@@ -698,13 +698,13 @@
        switch (ctx->pos) {
        case 0:
                ino = inode->i_ino;
- if (!dir_emit(ctx, ".", 1, ino, DT_DIR) < 0)
+ if ( dir_emit(ctx, ".", 1, ino, DT_DIR) )
                        goto out;
                ctx->pos++;
                /* fall through */
        case 1:
                ino = parent_ino(dentry);
- if (!dir_emit(ctx, "..", 2, ino, DT_DIR) < 0)
+ if (dir_emit(ctx, "..", 2, ino, DT_DIR))
                        goto out;
                ctx->pos++;
                /* fall through */
@@ -851,13 +851,13 @@
        switch (ctx->pos) {
        case 0:
                ino = inode->i_ino;
- if (!dir_emit(ctx, ".", 1, ino, DT_DIR) < 0)
+ if ( dir_emit(ctx, ".", 1, ino, DT_DIR) )
                        goto out;
                ctx->pos++;
                /* fall through */
        case 1:
                ino = parent_ino(dentry);
- if (!dir_emit(ctx, "..", 2, ino, DT_DIR) < 0)
+ if (dir_emit(ctx, "..", 2, ino, DT_DIR))
                        goto out;
                ctx->pos++;
                /* fall through */
@@ -932,13 +932,13 @@
        switch (ctx->pos) {
        case 0:
                ino = inode->i_ino;
- if (!dir_emit(ctx, ".", 1, ino, DT_DIR) < 0)
+ if ( dir_emit(ctx, ".", 1, ino, DT_DIR) )
                        goto out;
                ctx->pos++;
                /* fall through */
        case 1:
                ino = parent_ino(dentry);
- if (!dir_emit(ctx, "..", 2, ino, DT_DIR) < 0)
+ if (dir_emit(ctx, "..", 2, ino, DT_DIR))
                        goto out;
                ctx->pos++;
                /* fall through */
---------------------------------------

solve the :

kernel/vserver/proc.c: In function ‘proc_xid_iterate’:
kernel/vserver/proc.c:620:43: warning: comparison of constant ‘0’ with boolean expression is always false [-Wbool-compare]
   if (!dir_emit(ctx, ".", 1, ino, DT_DIR) < 0)
                                           ^
kernel/vserver/proc.c:626:44: warning: comparison of constant ‘0’ with boolean expression is always false [-Wbool-compare]
   if (!dir_emit(ctx, "..", 2, ino, DT_DIR) < 0)
                                            ^
kernel/vserver/proc.c: In function ‘proc_nid_iterate’:
kernel/vserver/proc.c:701:43: warning: comparison of constant ‘0’ with boolean expression is always false [-Wbool-compare]
   if (!dir_emit(ctx, ".", 1, ino, DT_DIR) < 0)
                                           ^
kernel/vserver/proc.c:707:44: warning: comparison of constant ‘0’ with boolean expression is always false [-Wbool-compare]
   if (!dir_emit(ctx, "..", 2, ino, DT_DIR) < 0)
                                            ^
kernel/vserver/proc.c: In function ‘proc_virtual_iterate’:
kernel/vserver/proc.c:854:43: warning: comparison of constant ‘0’ with boolean expression is always false [-Wbool-compare]
   if (!dir_emit(ctx, ".", 1, ino, DT_DIR) < 0)
                                           ^
kernel/vserver/proc.c:860:44: warning: comparison of constant ‘0’ with boolean expression is always false [-Wbool-compare]
   if (!dir_emit(ctx, "..", 2, ino, DT_DIR) < 0)
                                            ^
kernel/vserver/proc.c: In function ‘proc_virtnet_iterate’:
kernel/vserver/proc.c:935:43: warning: comparison of constant ‘0’ with boolean expression is always false [-Wbool-compare]
   if (!dir_emit(ctx, ".", 1, ino, DT_DIR) < 0)
                                           ^
kernel/vserver/proc.c:941:44: warning: comparison of constant ‘0’ with boolean expression is always false [-Wbool-compare]
   if (!dir_emit(ctx, "..", 2, ino, DT_DIR) < 0)

in the right way ?

best regards,
Ghislain.
Received on Fri Dec 29 08:04:21 2017

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Fri 29 Dec 2017 - 08:04:21 GMT by hypermail 2.1.8