* [axboe-block:read_iter 3/3] fs/signalfd.c:202:34: warning: variable 'siginfo' set but not used
@ 2024-04-02 20:21 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-04-02 20:21 UTC (permalink / raw)
To: Jens Axboe; +Cc: llvm, oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git read_iter
head: 1a84ffcd0664911af64861f2cb3a35193ef6b62e
commit: 1a84ffcd0664911af64861f2cb3a35193ef6b62e [3/3] signalfd: convert to ->read_iter()
config: x86_64-allnoconfig (https://download.01.org/0day-ci/archive/20240403/202404030421.ir3Jerlp-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240403/202404030421.ir3Jerlp-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404030421.ir3Jerlp-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> fs/signalfd.c:202:34: warning: variable 'siginfo' set but not used [-Wunused-but-set-variable]
202 | struct signalfd_siginfo __user *siginfo;
| ^
>> fs/signalfd.c:220:3: warning: variable 'siginfo' is uninitialized when used here [-Wuninitialized]
220 | siginfo++;
| ^~~~~~~
fs/signalfd.c:202:41: note: initialize the variable 'siginfo' to silence this warning
202 | struct signalfd_siginfo __user *siginfo;
| ^
| = NULL
2 warnings generated.
vim +/siginfo +202 fs/signalfd.c
fba2afaaec790d Davide Libenzi 2007-05-10 192
b3762bfc8d0463 Davi Arnaut 2007-05-23 193 /*
b8fceee17a310f Davide Libenzi 2007-09-20 194 * Returns a multiple of the size of a "struct signalfd_siginfo", or a negative
b8fceee17a310f Davide Libenzi 2007-09-20 195 * error code. The "count" parameter must be at least the size of a
b8fceee17a310f Davide Libenzi 2007-09-20 196 * "struct signalfd_siginfo".
b3762bfc8d0463 Davi Arnaut 2007-05-23 197 */
1a84ffcd066491 Jens Axboe 2024-04-02 198 static ssize_t signalfd_read_iter(struct kiocb *iocb, struct iov_iter *to)
b3762bfc8d0463 Davi Arnaut 2007-05-23 199 {
1a84ffcd066491 Jens Axboe 2024-04-02 200 struct file *file = iocb->ki_filp;
b3762bfc8d0463 Davi Arnaut 2007-05-23 201 struct signalfd_ctx *ctx = file->private_data;
b3762bfc8d0463 Davi Arnaut 2007-05-23 @202 struct signalfd_siginfo __user *siginfo;
1a84ffcd066491 Jens Axboe 2024-04-02 203 size_t count = iov_iter_count(to);
b3762bfc8d0463 Davi Arnaut 2007-05-23 204 ssize_t ret, total = 0;
ae7795bc6187a1 Eric W. Biederman 2018-09-25 205 kernel_siginfo_t info;
1a84ffcd066491 Jens Axboe 2024-04-02 206 bool nonblock;
b3762bfc8d0463 Davi Arnaut 2007-05-23 207
b3762bfc8d0463 Davi Arnaut 2007-05-23 208 count /= sizeof(struct signalfd_siginfo);
b3762bfc8d0463 Davi Arnaut 2007-05-23 209 if (!count)
b3762bfc8d0463 Davi Arnaut 2007-05-23 210 return -EINVAL;
b3762bfc8d0463 Davi Arnaut 2007-05-23 211
1a84ffcd066491 Jens Axboe 2024-04-02 212 nonblock = file->f_flags & O_NONBLOCK || iocb->ki_flags & IOCB_NOWAIT;
b3762bfc8d0463 Davi Arnaut 2007-05-23 213 do {
b3762bfc8d0463 Davi Arnaut 2007-05-23 214 ret = signalfd_dequeue(ctx, &info, nonblock);
b3762bfc8d0463 Davi Arnaut 2007-05-23 215 if (unlikely(ret <= 0))
b3762bfc8d0463 Davi Arnaut 2007-05-23 216 break;
1a84ffcd066491 Jens Axboe 2024-04-02 217 ret = signalfd_copyinfo(to, &info);
b3762bfc8d0463 Davi Arnaut 2007-05-23 218 if (ret < 0)
b3762bfc8d0463 Davi Arnaut 2007-05-23 219 break;
b3762bfc8d0463 Davi Arnaut 2007-05-23 @220 siginfo++;
b3762bfc8d0463 Davi Arnaut 2007-05-23 221 total += ret;
b3762bfc8d0463 Davi Arnaut 2007-05-23 222 nonblock = 1;
b3762bfc8d0463 Davi Arnaut 2007-05-23 223 } while (--count);
b3762bfc8d0463 Davi Arnaut 2007-05-23 224
b3762bfc8d0463 Davi Arnaut 2007-05-23 225 return total ? total: ret;
fba2afaaec790d Davide Libenzi 2007-05-10 226 }
fba2afaaec790d Davide Libenzi 2007-05-10 227
:::::: The code at line 202 was first introduced by commit
:::::: b3762bfc8d046342db664d855f8f875e8a4c2ca1 signalfd: retrieve multiple signals with one read() call
:::::: TO: Davi Arnaut <davi@haxent.com.br>
:::::: CC: Linus Torvalds <torvalds@woody.linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-04-02 20:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-02 20:21 [axboe-block:read_iter 3/3] fs/signalfd.c:202:34: warning: variable 'siginfo' set but not used 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