llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yury Norov <yury.norov@gmail.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org
Subject: [norov:bitmap-for-next 43/43] lib/bitmap.c:1571:22: warning: unsequenced modification and access to 'i'
Date: Mon, 11 Apr 2022 05:51:50 +0800	[thread overview]
Message-ID: <202204110545.nVd02heW-lkp@intel.com> (raw)

tree:   https://github.com/norov/linux bitmap-for-next
head:   a136dfabd10d0c1354c41a069cc4e00147a721e1
commit: a136dfabd10d0c1354c41a069cc4e00147a721e1 [43/43] bitmap_from_arr64
config: arm-hackkit_defconfig (https://download.01.org/0day-ci/archive/20220411/202204110545.nVd02heW-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 256c6b0ba14e8a7ab6373b61b7193ea8c0a3651c)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://github.com/norov/linux/commit/a136dfabd10d0c1354c41a069cc4e00147a721e1
        git remote add norov https://github.com/norov/linux
        git fetch --no-tags norov bitmap-for-next
        git checkout a136dfabd10d0c1354c41a069cc4e00147a721e1
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> lib/bitmap.c:1571:22: warning: unsequenced modification and access to 'i' [-Wunsequenced]
                   buf[i/2] = bitmap[i++];
                       ~              ^
>> lib/bitmap.c:1573:28: warning: shift count >= width of type [-Wshift-count-overflow]
                           buf[i/2] |= bitmap[i++] << 32;
                                                   ^  ~~
   lib/bitmap.c:1573:24: warning: unsequenced modification and access to 'i' [-Wunsequenced]
                           buf[i/2] |= bitmap[i++] << 32;
                               ~               ^
   3 warnings generated.


vim +/i +1571 lib/bitmap.c

  1559	
  1560	/**
  1561	 * bitmap_to_arr64 - copy the contents of bitmap to a u64 array of bits
  1562	 *	@buf: array of u64 (in host byte order), the dest bitmap
  1563	 *	@bitmap: array of unsigned longs, the source bitmap
  1564	 *	@nbits: number of bits in @bitmap
  1565	 */
  1566	void bitmap_to_arr64(u64 *buf, const unsigned long *bitmap, unsigned int nbits)
  1567	{
  1568		unsigned int i = 0, words = BITS_TO_LONGS(nbits);
  1569	
  1570		while (i < words) {
> 1571			buf[i/2] = bitmap[i++];
  1572			if (i < words)
> 1573				buf[i/2] |= bitmap[i++] << 32;
  1574		}
  1575	
  1576		/* Clear tail bits in last element of array beyond nbits. */
  1577		if (nbits % 64)
  1578			buf[i - 1] &= GENMASK_ULL(nbits, 0);
  1579	}
  1580	EXPORT_SYMBOL(bitmap_to_arr64);
  1581	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-04-10 21:52 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=202204110545.nVd02heW-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=yury.norov@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).