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, Dan Carpenter <error27@gmail.com>
Subject: [tip:x86/percpu 12/13] fs/buffer.c:1386 lookup_bh_lru() warn: ignoring unreachable code.
Date: Thu, 12 Oct 2023 03:51:21 +0800	[thread overview]
Message-ID: <202310120312.btjwLOvX-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
CC: x86@kernel.org
TO: Uros Bizjak <ubizjak@gmail.com>
CC: Ingo Molnar <mingo@kernel.org>
CC: Nadav Amit <namit@vmware.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/percpu
head:   e29aad08b1da7772b362537be32335c0394e65fe
commit: ca4256348660cb2162668ec3d13d1f921d05374a [12/13] x86/percpu: Use C for percpu read/write accessors
:::::: branch date: 22 hours ago
:::::: commit date: 7 days ago
config: i386-randconfig-141-20231011 (https://download.01.org/0day-ci/archive/20231012/202310120312.btjwLOvX-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231012/202310120312.btjwLOvX-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: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202310120312.btjwLOvX-lkp@intel.com/

New smatch warnings:
fs/buffer.c:1386 lookup_bh_lru() warn: ignoring unreachable code.
fs/buffer.c:1386 lookup_bh_lru() warn: ignoring unreachable code.
fs/buffer.c:1386 lookup_bh_lru() warn: inconsistent indenting

Old smatch warnings:
fs/buffer.c:1390 lookup_bh_lru() warn: inconsistent indenting

vim +1386 fs/buffer.c

^1da177e4c3f41 Linus Torvalds    2005-04-16  1363  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1364  /*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1365   * Look up the bh in this cpu's LRU.  If it's there, move it to the head.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1366   */
858119e1593843 Arjan van de Ven  2006-01-14  1367  static struct buffer_head *
3991d3bd150639 Tomasz Kvarsin    2007-02-12  1368  lookup_bh_lru(struct block_device *bdev, sector_t block, unsigned size)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1369  {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1370  	struct buffer_head *ret = NULL;
3991d3bd150639 Tomasz Kvarsin    2007-02-12  1371  	unsigned int i;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1372  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1373  	check_irqs_on();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1374  	bh_lru_lock();
8a237adf213d73 Marcelo Tosatti   2023-06-27  1375  	if (cpu_is_isolated(smp_processor_id())) {
8a237adf213d73 Marcelo Tosatti   2023-06-27  1376  		bh_lru_unlock();
8a237adf213d73 Marcelo Tosatti   2023-06-27  1377  		return NULL;
8a237adf213d73 Marcelo Tosatti   2023-06-27  1378  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1379  	for (i = 0; i < BH_LRU_SIZE; i++) {
c7b92516a9c68f Christoph Lameter 2010-12-06  1380  		struct buffer_head *bh = __this_cpu_read(bh_lrus.bhs[i]);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1381  
9470dd5d352985 Zach Brown        2014-10-13  1382  		if (bh && bh->b_blocknr == block && bh->b_bdev == bdev &&
9470dd5d352985 Zach Brown        2014-10-13  1383  		    bh->b_size == size) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1384  			if (i) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1385  				while (i) {
c7b92516a9c68f Christoph Lameter 2010-12-06 @1386  					__this_cpu_write(bh_lrus.bhs[i],
c7b92516a9c68f Christoph Lameter 2010-12-06  1387  						__this_cpu_read(bh_lrus.bhs[i - 1]));
^1da177e4c3f41 Linus Torvalds    2005-04-16  1388  					i--;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1389  				}
c7b92516a9c68f Christoph Lameter 2010-12-06  1390  				__this_cpu_write(bh_lrus.bhs[0], bh);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1391  			}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1392  			get_bh(bh);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1393  			ret = bh;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1394  			break;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1395  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1396  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1397  	bh_lru_unlock();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1398  	return ret;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1399  }
^1da177e4c3f41 Linus Torvalds    2005-04-16  1400  

:::::: The code at line 1386 was first introduced by commit
:::::: c7b92516a9c68fa5403879225a5a19974a801ef6 fs: Use this_cpu_xx operations in buffer.c

:::::: TO: Christoph Lameter <cl@linux.com>
:::::: CC: Tejun Heo <tj@kernel.org>

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

                 reply	other threads:[~2023-10-11 19:51 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=202310120312.btjwLOvX-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --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.