From: kernel test robot <[email protected]>
To: David Howells <[email protected]>
Cc: [email protected], [email protected],
Ammar Faizi <[email protected]>,
GNU/Weeb Mailing List <[email protected]>
Subject: [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
Date: Sat, 11 Feb 2023 09:30:13 +0800 [thread overview]
Message-ID: <[email protected]> (raw)
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
reply other threads:[~2023-02-11 1:30 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