0 day kernel build service
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Julia Lawall <julia.lawall@inria.fr>
Subject: [linux-next:master 1831/9043] fs/iomap/direct-io.c:939:36-37: WARNING opportunity for min()
Date: Sun, 26 Jul 2026 02:57:21 +0800	[thread overview]
Message-ID: <202607260226.sVPNzyMU-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Fengnan Chang <changfengnan@bytedance.com>
CC: Christian Brauner <brauner@kernel.org>
CC: Christoph Hellwig <hch@lst.de>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   9eebf259d5352b87080d67758f483583d9e763d7
commit: c45650e4f8ba25d02e860094a77bf85ec3a35f13 [1831/9043] iomap: add simple dio path for small direct I/O
:::::: branch date: 2 days ago
:::::: commit date: 3 weeks ago
config: microblaze-randconfig-r053-20260725 (https://download.01.org/0day-ci/archive/20260726/202607260226.sVPNzyMU-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 8.5.0

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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202607260226.sVPNzyMU-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/iomap/direct-io.c:939:36-37: WARNING opportunity for min()

vim +939 fs/iomap/direct-io.c

c45650e4f8ba25 Fengnan Chang 2026-07-01  913  
c45650e4f8ba25 Fengnan Chang 2026-07-01  914  static ssize_t iomap_dio_simple_complete(struct iomap_dio_simple *sr)
c45650e4f8ba25 Fengnan Chang 2026-07-01  915  {
c45650e4f8ba25 Fengnan Chang 2026-07-01  916  	struct bio *bio = &sr->bio;
c45650e4f8ba25 Fengnan Chang 2026-07-01  917  	struct kiocb *iocb = sr->iocb;
c45650e4f8ba25 Fengnan Chang 2026-07-01  918  	struct inode *inode = file_inode(iocb->ki_filp);
c45650e4f8ba25 Fengnan Chang 2026-07-01  919  	ssize_t ret;
c45650e4f8ba25 Fengnan Chang 2026-07-01  920  
c45650e4f8ba25 Fengnan Chang 2026-07-01  921  	if (unlikely(bio->bi_status)) {
c45650e4f8ba25 Fengnan Chang 2026-07-01  922  		ret = blk_status_to_errno(bio->bi_status);
c45650e4f8ba25 Fengnan Chang 2026-07-01  923  		if (should_report_dio_fserror(ret))
c45650e4f8ba25 Fengnan Chang 2026-07-01  924  			fserror_report_io(inode, FSERR_DIRECTIO_READ,
c45650e4f8ba25 Fengnan Chang 2026-07-01  925  					  iocb->ki_pos, sr->size, ret,
c45650e4f8ba25 Fengnan Chang 2026-07-01  926  					  GFP_NOFS);
c45650e4f8ba25 Fengnan Chang 2026-07-01  927  	} else {
c45650e4f8ba25 Fengnan Chang 2026-07-01  928  		ret = sr->size;
c45650e4f8ba25 Fengnan Chang 2026-07-01  929  		iocb->ki_pos += ret;
c45650e4f8ba25 Fengnan Chang 2026-07-01  930  	}
c45650e4f8ba25 Fengnan Chang 2026-07-01  931  
c45650e4f8ba25 Fengnan Chang 2026-07-01  932  	if (sr->dio_flags & IOMAP_DIO_USER_BACKED) {
c45650e4f8ba25 Fengnan Chang 2026-07-01  933  		bio_check_pages_dirty(bio);
c45650e4f8ba25 Fengnan Chang 2026-07-01  934  	} else {
c45650e4f8ba25 Fengnan Chang 2026-07-01  935  		bio_release_pages(bio, false);
c45650e4f8ba25 Fengnan Chang 2026-07-01  936  		bio_put(bio);
c45650e4f8ba25 Fengnan Chang 2026-07-01  937  	}
c45650e4f8ba25 Fengnan Chang 2026-07-01  938  	inode_dio_end(inode);
c45650e4f8ba25 Fengnan Chang 2026-07-01 @939  	trace_iomap_dio_complete(iocb, ret < 0 ? ret : 0, ret);
c45650e4f8ba25 Fengnan Chang 2026-07-01  940  	return ret;
c45650e4f8ba25 Fengnan Chang 2026-07-01  941  }
c45650e4f8ba25 Fengnan Chang 2026-07-01  942  

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

                 reply	other threads:[~2026-07-25 18:57 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=202607260226.sVPNzyMU-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=julia.lawall@inria.fr \
    --cc=oe-kbuild@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