Linux: -Wunused-value in net/xdp

Created on 18 Jun 2019  路  5Comments  路  Source: ClangBuiltLinux/linux

When testing the patch in #520, on either 32-bit or 64-bit ARM:

In file included from net/xdp/xsk_queue.c:10:
net/xdp/xsk_queue.h:292:2: warning: expression result unused [-Wunused-value]
        WRITE_ONCE(q->ring->producer, q->prod_tail);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:284:6: note: expanded from macro 'WRITE_ONCE'
        __u.__val;                                      \
        ~~~ ^~~~~
1 warning generated.
In file included from net/xdp/xsk_diag.c:14:
net/xdp/xsk_queue.h:292:2: warning: expression result unused [-Wunused-value]
        WRITE_ONCE(q->ring->producer, q->prod_tail);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:284:6: note: expanded from macro 'WRITE_ONCE'
        __u.__val;                                      \
        ~~~ ^~~~~
1 warning generated.
In file included from net/xdp/xdp_umem.c:19:
net/xdp/xsk_queue.h:292:2: warning: expression result unused [-Wunused-value]
        WRITE_ONCE(q->ring->producer, q->prod_tail);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:284:6: note: expanded from macro 'WRITE_ONCE'
        __u.__val;                                      \
        ~~~ ^~~~~
1 warning generated.
In file included from net/xdp/xsk.c:28:
net/xdp/xsk_queue.h:292:2: warning: expression result unused [-Wunused-value]
        WRITE_ONCE(q->ring->producer, q->prod_tail);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:284:6: note: expanded from macro 'WRITE_ONCE'
        __u.__val;                                      \
        ~~~ ^~~~~
1 warning generated.

Also reported by @tmroeder on that same thread.

Can be reproduced with make -j$(nproc) CC=clang allyesconfig net/xdp/

-Wunused-value [ARCH] arm32 [ARCH] arm64 [BUG] linux [FIXED][LINUX] 5.3

All 5 comments

This is now visible in -next for everyone because -Wunused-value has been turned on.

I've found the issue and am about to send a fix.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nickdesaulniers picture nickdesaulniers  路  4Comments

tpgxyz picture tpgxyz  路  4Comments

nathanchance picture nathanchance  路  3Comments

nickdesaulniers picture nickdesaulniers  路  4Comments

nickdesaulniers picture nickdesaulniers  路  4Comments