drivers/block/drbd/drbd_receiver.c:416:7: warning: expression result unused
From: kernel test robot
Date: Mon Aug 14 2023 - 16:46:38 EST
Hi Christoph,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 2ccdd1b13c591d306f0401d98dedc4bdcd02b421
commit: aa034695971124f673d4ccdd39cd7f269904ea86 drbd: introduce dynamic debug
date: 9 months ago
config: i386-randconfig-r033-20230815 (https://download.01.org/0day-ci/archive/20230815/202308150414.eG2nMDlx-lkp@xxxxxxxxx/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce: (https://download.01.org/0day-ci/archive/20230815/202308150414.eG2nMDlx-lkp@xxxxxxxxx/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308150414.eG2nMDlx-lkp@xxxxxxxxx/
All warnings (new ones prefixed by >>):
>> drivers/block/drbd/drbd_receiver.c:416:7: warning: expression result unused [-Wunused-value]
if (!expect(!(peer_req->flags & EE_CALL_AL_COMPLETE_IO))) {
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/block/drbd/drbd_polymorph_printk.h:128:4: note: expanded from macro 'expect'
drbd_err(device, "ASSERTION %s FAILED in %s\n", \
^
drivers/block/drbd/drbd_polymorph_printk.h:104:2: note: expanded from macro 'drbd_err'
drbd_printk(KERN_ERR, device, fmt, ## args)
^
drivers/block/drbd/drbd_polymorph_printk.h:65:4: note: expanded from macro 'drbd_printk'
__drbd_printk_if_same_type(obj, drbd_device, level, fmt, ## args), \
^
drivers/block/drbd/drbd_polymorph_printk.h:55:47: note: expanded from macro '__drbd_printk_if_same_type'
__drbd_printk_choose_cond(obj, struct_name), \
^
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
>> drivers/block/drbd/drbd_receiver.c:416:7: warning: expression result unused [-Wunused-value]
if (!expect(!(peer_req->flags & EE_CALL_AL_COMPLETE_IO))) {
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/block/drbd/drbd_polymorph_printk.h:128:4: note: expanded from macro 'expect'
drbd_err(device, "ASSERTION %s FAILED in %s\n", \
^
drivers/block/drbd/drbd_polymorph_printk.h:104:2: note: expanded from macro 'drbd_err'
drbd_printk(KERN_ERR, device, fmt, ## args)
^
drivers/block/drbd/drbd_polymorph_printk.h:65:4: note: expanded from macro 'drbd_printk'
__drbd_printk_if_same_type(obj, drbd_device, level, fmt, ## args), \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
~~~~~~~~~~~~~~~~~^~~~~
include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
(cond) ? \
^~~~
drivers/block/drbd/drbd_receiver.c:1876:8: warning: expression result unused [-Wunused-value]
if (!expect(data_size == 0))
~~~~~^~~~~~~~~~~~~~~~~~~~~~~
drivers/block/drbd/drbd_polymorph_printk.h:128:4: note: expanded from macro 'expect'
drbd_err(device, "ASSERTION %s FAILED in %s\n", \
^
drivers/block/drbd/drbd_polymorph_printk.h:104:2: note: expanded from macro 'drbd_err'
drbd_printk(KERN_ERR, device, fmt, ## args)
^
drivers/block/drbd/drbd_polymorph_printk.h:65:4: note: expanded from macro 'drbd_printk'
__drbd_printk_if_same_type(obj, drbd_device, level, fmt, ## args), \
^
drivers/block/drbd/drbd_polymorph_printk.h:55:47: note: expanded from macro '__drbd_printk_if_same_type'
__drbd_printk_choose_cond(obj, struct_name), \
^
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
drivers/block/drbd/drbd_receiver.c:1876:8: warning: expression result unused [-Wunused-value]
if (!expect(data_size == 0))
~~~~~^~~~~~~~~~~~~~~~~~~~~~~
drivers/block/drbd/drbd_polymorph_printk.h:128:4: note: expanded from macro 'expect'
drbd_err(device, "ASSERTION %s FAILED in %s\n", \
^
drivers/block/drbd/drbd_polymorph_printk.h:104:2: note: expanded from macro 'drbd_err'
drbd_printk(KERN_ERR, device, fmt, ## args)
^
drivers/block/drbd/drbd_polymorph_printk.h:65:4: note: expanded from macro 'drbd_printk'
__drbd_printk_if_same_type(obj, drbd_device, level, fmt, ## args), \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
~~~~~~~~~~~~~~~~~^~~~~
include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
(cond) ? \
^~~~
drivers/block/drbd/drbd_receiver.c:1880:8: warning: expression result unused [-Wunused-value]
if (!expect(data_size == 0))
~~~~~^~~~~~~~~~~~~~~~~~~~~~~
drivers/block/drbd/drbd_polymorph_printk.h:128:4: note: expanded from macro 'expect'
drbd_err(device, "ASSERTION %s FAILED in %s\n", \
^
drivers/block/drbd/drbd_polymorph_printk.h:104:2: note: expanded from macro 'drbd_err'
drbd_printk(KERN_ERR, device, fmt, ## args)
^
drivers/block/drbd/drbd_polymorph_printk.h:65:4: note: expanded from macro 'drbd_printk'
__drbd_printk_if_same_type(obj, drbd_device, level, fmt, ## args), \
^
drivers/block/drbd/drbd_polymorph_printk.h:55:47: note: expanded from macro '__drbd_printk_if_same_type'
__drbd_printk_choose_cond(obj, struct_name), \
^
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
drivers/block/drbd/drbd_receiver.c:1880:8: warning: expression result unused [-Wunused-value]
if (!expect(data_size == 0))
~~~~~^~~~~~~~~~~~~~~~~~~~~~~
drivers/block/drbd/drbd_polymorph_printk.h:128:4: note: expanded from macro 'expect'
drbd_err(device, "ASSERTION %s FAILED in %s\n", \
^
drivers/block/drbd/drbd_polymorph_printk.h:104:2: note: expanded from macro 'drbd_err'
drbd_printk(KERN_ERR, device, fmt, ## args)
^
drivers/block/drbd/drbd_polymorph_printk.h:65:4: note: expanded from macro 'drbd_printk'
__drbd_printk_if_same_type(obj, drbd_device, level, fmt, ## args), \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
--
In file included from drivers/block/drbd/drbd_nl.c:78:
include/linux/genl_magic_func.h:212:13: warning: no previous prototype for function 'drbd_genl_cmd_to_str' [-Wmissing-prototypes]
const char *CONCAT_(GENL_MAGIC_FAMILY, _genl_cmd_to_str)(__u8 cmd)
^
include/linux/genl_magic_struct.h:21:22: note: expanded from macro 'CONCAT_'
#define CONCAT_(a,b) CONCAT__(a,b)
^
include/linux/genl_magic_struct.h:20:23: note: expanded from macro 'CONCAT__'
#define CONCAT__(a,b) a ## b
^
<scratch space>:148:1: note: expanded from here
drbd_genl_cmd_to_str
^
include/linux/genl_magic_func.h:212:7: note: declare 'static' if the function is not intended to be used outside of this translation unit
const char *CONCAT_(GENL_MAGIC_FAMILY, _genl_cmd_to_str)(__u8 cmd)
^
static
>> drivers/block/drbd/drbd_nl.c:1546:7: warning: expression result unused [-Wunused-value]
if (!expect(new_disk_conf->resync_rate >= 1))
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/block/drbd/drbd_polymorph_printk.h:128:4: note: expanded from macro 'expect'
drbd_err(device, "ASSERTION %s FAILED in %s\n", \
^
drivers/block/drbd/drbd_polymorph_printk.h:104:2: note: expanded from macro 'drbd_err'
drbd_printk(KERN_ERR, device, fmt, ## args)
^
drivers/block/drbd/drbd_polymorph_printk.h:65:4: note: expanded from macro 'drbd_printk'
__drbd_printk_if_same_type(obj, drbd_device, level, fmt, ## args), \
^
drivers/block/drbd/drbd_polymorph_printk.h:55:47: note: expanded from macro '__drbd_printk_if_same_type'
__drbd_printk_choose_cond(obj, struct_name), \
^
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
>> drivers/block/drbd/drbd_nl.c:1546:7: warning: expression result unused [-Wunused-value]
if (!expect(new_disk_conf->resync_rate >= 1))
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/block/drbd/drbd_polymorph_printk.h:128:4: note: expanded from macro 'expect'
drbd_err(device, "ASSERTION %s FAILED in %s\n", \
^
drivers/block/drbd/drbd_polymorph_printk.h:104:2: note: expanded from macro 'drbd_err'
drbd_printk(KERN_ERR, device, fmt, ## args)
^
drivers/block/drbd/drbd_polymorph_printk.h:65:4: note: expanded from macro 'drbd_printk'
__drbd_printk_if_same_type(obj, drbd_device, level, fmt, ## args), \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
~~~~~~~~~~~~~~~~~^~~~~
include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
(cond) ? \
^~~~
3 warnings generated.
--
>> drivers/block/drbd/drbd_bitmap.c:451:7: warning: expression result unused [-Wunused-value]
if (!expect(device->bitmap))
~~~~~^~~~~~~~~~~~~~~~~~~~~~~
drivers/block/drbd/drbd_polymorph_printk.h:128:4: note: expanded from macro 'expect'
drbd_err(device, "ASSERTION %s FAILED in %s\n", \
^
drivers/block/drbd/drbd_polymorph_printk.h:104:2: note: expanded from macro 'drbd_err'
drbd_printk(KERN_ERR, device, fmt, ## args)
^
drivers/block/drbd/drbd_polymorph_printk.h:65:4: note: expanded from macro 'drbd_printk'
__drbd_printk_if_same_type(obj, drbd_device, level, fmt, ## args), \
^
drivers/block/drbd/drbd_polymorph_printk.h:55:47: note: expanded from macro '__drbd_printk_if_same_type'
__drbd_printk_choose_cond(obj, struct_name), \
^
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
>> drivers/block/drbd/drbd_bitmap.c:451:7: warning: expression result unused [-Wunused-value]
if (!expect(device->bitmap))
~~~~~^~~~~~~~~~~~~~~~~~~~~~~
drivers/block/drbd/drbd_polymorph_printk.h:128:4: note: expanded from macro 'expect'
drbd_err(device, "ASSERTION %s FAILED in %s\n", \
^
drivers/block/drbd/drbd_polymorph_printk.h:104:2: note: expanded from macro 'drbd_err'
drbd_printk(KERN_ERR, device, fmt, ## args)
^
drivers/block/drbd/drbd_polymorph_printk.h:65:4: note: expanded from macro 'drbd_printk'
__drbd_printk_if_same_type(obj, drbd_device, level, fmt, ## args), \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
~~~~~~~~~~~~~~~~~^~~~~
include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
(cond) ? \
^~~~
drivers/block/drbd/drbd_bitmap.c:460:7: warning: expression result unused [-Wunused-value]
if (!expect(device->bitmap))
~~~~~^~~~~~~~~~~~~~~~~~~~~~~
drivers/block/drbd/drbd_polymorph_printk.h:128:4: note: expanded from macro 'expect'
drbd_err(device, "ASSERTION %s FAILED in %s\n", \
^
drivers/block/drbd/drbd_polymorph_printk.h:104:2: note: expanded from macro 'drbd_err'
drbd_printk(KERN_ERR, device, fmt, ## args)
^
drivers/block/drbd/drbd_polymorph_printk.h:65:4: note: expanded from macro 'drbd_printk'
__drbd_printk_if_same_type(obj, drbd_device, level, fmt, ## args), \
^
drivers/block/drbd/drbd_polymorph_printk.h:55:47: note: expanded from macro '__drbd_printk_if_same_type'
__drbd_printk_choose_cond(obj, struct_name), \
^
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
drivers/block/drbd/drbd_bitmap.c:460:7: warning: expression result unused [-Wunused-value]
if (!expect(device->bitmap))
~~~~~^~~~~~~~~~~~~~~~~~~~~~~
drivers/block/drbd/drbd_polymorph_printk.h:128:4: note: expanded from macro 'expect'
drbd_err(device, "ASSERTION %s FAILED in %s\n", \
^
drivers/block/drbd/drbd_polymorph_printk.h:104:2: note: expanded from macro 'drbd_err'
drbd_printk(KERN_ERR, device, fmt, ## args)
^
drivers/block/drbd/drbd_polymorph_printk.h:65:4: note: expanded from macro 'drbd_printk'
__drbd_printk_if_same_type(obj, drbd_device, level, fmt, ## args), \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
~~~~~~~~~~~~~~~~~^~~~~
include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
(cond) ? \
^~~~
drivers/block/drbd/drbd_bitmap.c:639:7: warning: expression result unused [-Wunused-value]
if (!expect(b))
~~~~~^~~~~~~~~~
drivers/block/drbd/drbd_polymorph_printk.h:128:4: note: expanded from macro 'expect'
drbd_err(device, "ASSERTION %s FAILED in %s\n", \
^
drivers/block/drbd/drbd_polymorph_printk.h:104:2: note: expanded from macro 'drbd_err'
drbd_printk(KERN_ERR, device, fmt, ## args)
^
drivers/block/drbd/drbd_polymorph_printk.h:65:4: note: expanded from macro 'drbd_printk'
__drbd_printk_if_same_type(obj, drbd_device, level, fmt, ## args), \
^
drivers/block/drbd/drbd_polymorph_printk.h:55:47: note: expanded from macro '__drbd_printk_if_same_type'
__drbd_printk_choose_cond(obj, struct_name), \
^
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
drivers/block/drbd/drbd_bitmap.c:639:7: warning: expression result unused [-Wunused-value]
if (!expect(b))
~~~~~^~~~~~~~~~
drivers/block/drbd/drbd_polymorph_printk.h:128:4: note: expanded from macro 'expect'
drbd_err(device, "ASSERTION %s FAILED in %s\n", \
^
drivers/block/drbd/drbd_polymorph_printk.h:104:2: note: expanded from macro 'drbd_err'
drbd_printk(KERN_ERR, device, fmt, ## args)
^
drivers/block/drbd/drbd_polymorph_printk.h:65:4: note: expanded from macro 'drbd_printk'
__drbd_printk_if_same_type(obj, drbd_device, level, fmt, ## args), \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
..
vim +416 drivers/block/drbd/drbd_receiver.c
b411b3637fa71f Philipp Reisner 2009-09-25 406
b30ab7913b0a7b Andreas Gruenbacher 2011-07-03 407 void __drbd_free_peer_req(struct drbd_device *device, struct drbd_peer_request *peer_req,
f6ffca9f429025 Andreas Gruenbacher 2011-02-04 408 int is_net)
b411b3637fa71f Philipp Reisner 2009-09-25 409 {
21ae5d7f95aa1a Lars Ellenberg 2014-05-05 410 might_sleep();
db830c464b69e2 Andreas Gruenbacher 2011-02-04 411 if (peer_req->flags & EE_HAS_DIGEST)
db830c464b69e2 Andreas Gruenbacher 2011-02-04 412 kfree(peer_req->digest);
b30ab7913b0a7b Andreas Gruenbacher 2011-07-03 413 drbd_free_pages(device, peer_req->pages, is_net);
0b0ba1efc7b887 Andreas Gruenbacher 2011-06-27 414 D_ASSERT(device, atomic_read(&peer_req->pending_bios) == 0);
0b0ba1efc7b887 Andreas Gruenbacher 2011-06-27 415 D_ASSERT(device, drbd_interval_empty(&peer_req->i));
21ae5d7f95aa1a Lars Ellenberg 2014-05-05 @416 if (!expect(!(peer_req->flags & EE_CALL_AL_COMPLETE_IO))) {
21ae5d7f95aa1a Lars Ellenberg 2014-05-05 417 peer_req->flags &= ~EE_CALL_AL_COMPLETE_IO;
21ae5d7f95aa1a Lars Ellenberg 2014-05-05 418 drbd_al_complete_io(device, &peer_req->i);
21ae5d7f95aa1a Lars Ellenberg 2014-05-05 419 }
0892fac8719f06 Kent Overstreet 2018-05-20 420 mempool_free(peer_req, &drbd_ee_mempool);
b411b3637fa71f Philipp Reisner 2009-09-25 421 }
b411b3637fa71f Philipp Reisner 2009-09-25 422
:::::: The code at line 416 was first introduced by commit
:::::: 21ae5d7f95aa1a64f35b03c91f8714ced3ab61a9 drbd: track timing details of peer_requests
:::::: TO: Lars Ellenberg <lars.ellenberg@xxxxxxxxxx>
:::::: CC: Philipp Reisner <philipp.reisner@xxxxxxxxxx>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki