0 day kernel build service
 help / color / mirror / Atom feed
* [linux-next:master 1831/9043] fs/iomap/direct-io.c:939:36-37: WARNING opportunity for min()
@ 2026-07-25 18:57 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-07-25 18:57 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Julia Lawall

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-25 18:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-25 18:57 [linux-next:master 1831/9043] fs/iomap/direct-io.c:939:36-37: WARNING opportunity for min() 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