public inbox for [email protected]
 help / color / mirror / Atom feed
From: kernel test robot <[email protected]>
To: David Howells <[email protected]>
Cc: [email protected], [email protected],
	GNU/Weeb Mailing List <[email protected]>,
	[email protected]
Subject: [ammarfaizi2-block:dhowells/linux-fs/rxrpc-multiqueue 3/5] fs/afs/rxrpc.c:155:6: warning: variable 'o' is used uninitialized whenever 'if' condition is false
Date: Wed, 22 Jun 2022 03:34:00 +0800	[thread overview]
Message-ID: <[email protected]> (raw)

tree:   https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/rxrpc-multiqueue
head:   f37988fef6da3fdc3545e5a65eb9241f82f539f2
commit: 928631b5285b0aaebed61025256868cd126c9281 [3/5] rxrpc: Allow UDP socket sharing for AF_RXRPC service sockets
config: i386-randconfig-a015 (https://download.01.org/0day-ci/archive/20220622/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project af6d2a0b6825e71965f3e2701a63c239fa0ad70f)
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/928631b5285b0aaebed61025256868cd126c9281
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block dhowells/linux-fs/rxrpc-multiqueue
        git checkout 928631b5285b0aaebed61025256868cd126c9281
        # 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 SHELL=/bin/bash fs/afs/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

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


vim +155 fs/afs/rxrpc.c

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

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-06-21 19:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox