public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [axboe-block:read_iter 3/3] fs/signalfd.c:202:34: warning: variable 'siginfo' set but not used
Date: Wed, 3 Apr 2024 04:21:30 +0800	[thread overview]
Message-ID: <202404030421.ir3Jerlp-lkp@intel.com> (raw)

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

                 reply	other threads:[~2024-04-02 20:22 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 \
    --in-reply-to=202404030421.ir3Jerlp-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=axboe@kernel.dk \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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