All of lore.kernel.org
 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: fs/bcachefs/btree_gc.c:1443:12-13: WARNING opportunity for min()
Date: Tue, 5 Dec 2023 20:40:52 +0800	[thread overview]
Message-ID: <202312052013.Vxgm6EkD-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Kent Overstreet <kmo@daterainc.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   bee0e7762ad2c6025b9f5245c040fcc36ef2bde8
commit: 326568f18cb57ed95a420361da9a64330e122cda bcachefs: Convert bch2_gc_done() for_each_btree_key2()
date:   6 weeks ago
:::::: branch date: 15 hours ago
:::::: commit date: 6 weeks ago
config: x86_64-randconfig-104-20231204 (https://download.01.org/0day-ci/archive/20231205/202312052013.Vxgm6EkD-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce: (https://download.01.org/0day-ci/archive/20231205/202312052013.Vxgm6EkD-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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202312052013.Vxgm6EkD-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/bcachefs/btree_gc.c:1443:12-13: WARNING opportunity for min()

vim +1443 fs/bcachefs/btree_gc.c

ec061b215d63b5 Kent Overstreet 2021-12-25  1416  
78c8fe20be12d0 Kent Overstreet 2022-02-19  1417  static int bch2_gc_alloc_done(struct bch_fs *c, bool metadata_only)
ec061b215d63b5 Kent Overstreet 2021-12-25  1418  {
ec061b215d63b5 Kent Overstreet 2021-12-25  1419  	struct btree_trans trans;
ec061b215d63b5 Kent Overstreet 2021-12-25  1420  	struct btree_iter iter;
ec061b215d63b5 Kent Overstreet 2021-12-25  1421  	struct bkey_s_c k;
ec061b215d63b5 Kent Overstreet 2021-12-25  1422  	struct bch_dev *ca;
ec061b215d63b5 Kent Overstreet 2021-12-25  1423  	unsigned i;
ec061b215d63b5 Kent Overstreet 2021-12-25  1424  	int ret = 0;
ec061b215d63b5 Kent Overstreet 2021-12-25  1425  
ec061b215d63b5 Kent Overstreet 2021-12-25  1426  	bch2_trans_init(&trans, c, 0, 0);
ec061b215d63b5 Kent Overstreet 2021-12-25  1427  
ec061b215d63b5 Kent Overstreet 2021-12-25  1428  	for_each_member_device(ca, c, i) {
326568f18cb57e Kent Overstreet 2022-07-17  1429  		ret = for_each_btree_key_commit(&trans, iter, BTREE_ID_alloc,
ec061b215d63b5 Kent Overstreet 2021-12-25  1430  				POS(ca->dev_idx, ca->mi.first_bucket),
326568f18cb57e Kent Overstreet 2022-07-17  1431  				BTREE_ITER_SLOTS|BTREE_ITER_PREFETCH, k,
326568f18cb57e Kent Overstreet 2022-07-17  1432  				NULL, NULL, BTREE_INSERT_LAZY_RW,
326568f18cb57e Kent Overstreet 2022-07-17  1433  			bch2_alloc_write_key(&trans, &iter, k, metadata_only));
ec061b215d63b5 Kent Overstreet 2021-12-25  1434  
326568f18cb57e Kent Overstreet 2022-07-17  1435  		if (ret < 0) {
ec061b215d63b5 Kent Overstreet 2021-12-25  1436  			bch_err(c, "error writing alloc info: %i", ret);
ec061b215d63b5 Kent Overstreet 2021-12-25  1437  			percpu_ref_put(&ca->ref);
ec061b215d63b5 Kent Overstreet 2021-12-25  1438  			break;
ec061b215d63b5 Kent Overstreet 2021-12-25  1439  		}
28062d320bded2 Kent Overstreet 2019-02-20  1440  	}
9ca53b55f74157 Kent Overstreet 2018-07-23  1441  
ec061b215d63b5 Kent Overstreet 2021-12-25  1442  	bch2_trans_exit(&trans);
326568f18cb57e Kent Overstreet 2022-07-17 @1443  	return ret < 0 ? ret : 0;
ec061b215d63b5 Kent Overstreet 2021-12-25  1444  }
ec061b215d63b5 Kent Overstreet 2021-12-25  1445  

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

                 reply	other threads:[~2023-12-05 12:41 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=202312052013.Vxgm6EkD-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.