GNU/Weeb Mailing List <[email protected]>
 help / color / mirror / Atom feed
* [ammarfaizi2-block:dhowells/linux-fs/rxrpc-next 4/10] fs/afs/rxrpc.c:157:6: warning: variable 'o' is used uninitialized whenever 'if' condition is false
@ 2023-02-11  1:30 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-02-11  1:30 UTC (permalink / raw)
  To: David Howells; +Cc: llvm, oe-kbuild-all, Ammar Faizi, GNU/Weeb Mailing List

tree:   https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/rxrpc-next
head:   c661a1d21c087e6a776a85eb4c60fbba29caaf99
commit: 0f2dc9220002c9a8172c453b9550df310bf9bd60 [4/10] rxrpc: Allow UDP socket sharing for AF_RXRPC service sockets
config: i386-randconfig-a015 (https://download.01.org/0day-ci/archive/20230211/[email protected]/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/ammarfaizi2/linux-block/commit/0f2dc9220002c9a8172c453b9550df310bf9bd60
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block dhowells/linux-fs/rxrpc-next
        git checkout 0f2dc9220002c9a8172c453b9550df310bf9bd60
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash fs/afs/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> fs/afs/rxrpc.c:157:6: warning: variable 'o' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (!prealloc)
               ^~~~~~~~~
   fs/afs/rxrpc.c:159:58: note: uninitialized use occurs here
           trace_afs_call(call->debug_id, afs_call_trace_alloc, 1, o,
                                                                   ^
   fs/afs/rxrpc.c:157:2: note: remove the 'if' if its condition is always true
           if (!prealloc)
           ^~~~~~~~~~~~~~
   fs/afs/rxrpc.c:142:7: note: initialize the variable 'o' to silence this warning
           int o;
                ^
                 = 0
   1 warning generated.


vim +157 fs/afs/rxrpc.c

   133	
   134	/*
   135	 * Allocate a call.
   136	 */
   137	static struct afs_call *afs_alloc_call(struct afs_net *net,
   138					       const struct afs_call_type *type,
   139					       bool prealloc, gfp_t gfp)
   140	{
   141		struct afs_call *call;
   142		int o;
   143	
   144		call = kzalloc(sizeof(*call), gfp);
   145		if (!call)
   146			return NULL;
   147	
   148		call->type = type;
   149		call->net = net;
   150		call->debug_id = atomic_inc_return(&rxrpc_debug_id);
   151		refcount_set(&call->ref, 1);
   152		INIT_WORK(&call->async_work, afs_process_async_call);
   153		init_waitqueue_head(&call->waitq);
   154		spin_lock_init(&call->state_lock);
   155		call->iter = &call->def_iter;
   156	
 > 157		if (!prealloc)
   158			o = atomic_inc_return(&net->nr_outstanding_calls);
   159		trace_afs_call(call->debug_id, afs_call_trace_alloc, 1, o,
   160			       __builtin_return_address(0));
   161		return call;
   162	}
   163	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-11  1:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-11  1:30 [ammarfaizi2-block:dhowells/linux-fs/rxrpc-next 4/10] fs/afs/rxrpc.c:157:6: warning: variable 'o' is used uninitialized whenever 'if' condition is false kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox