mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Alexander Lobakin <alexandr.lobakin@intel.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [alobakin:bitops 7/8] include/linux/bitmap.h:447:22: warning: 'possible_idx[0]' is used uninitialized
Date: Wed, 22 Jun 2022 15:24:37 +0800	[thread overview]
Message-ID: <202206221502.VUxmhVnV-lkp@intel.com> (raw)

tree:   https://github.com/alobakin/linux bitops
head:   53dc46e3f72d9b77c9c4ec23a3261d452b3bd67a
commit: 37c8723a2d98c5edce8fb5e9c2e7b8e2d9b4291c [7/8] bitmap: don't assume compiler evaluates small mem*() builtins calls
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220622/202206221502.VUxmhVnV-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/alobakin/linux/commit/37c8723a2d98c5edce8fb5e9c2e7b8e2d9b4291c
        git remote add alobakin https://github.com/alobakin/linux
        git fetch --no-tags alobakin bitops
        git checkout 37c8723a2d98c5edce8fb5e9c2e7b8e2d9b4291c
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/net/ethernet/intel/ice/

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/cpumask.h:12,
                    from arch/x86/include/asm/cpumask.h:5,
                    from arch/x86/include/asm/msr.h:11,
                    from arch/x86/include/asm/processor.h:22,
                    from arch/x86/include/asm/timex.h:5,
                    from include/linux/timex.h:67,
                    from include/linux/time32.h:13,
                    from include/linux/time.h:60,
                    from include/linux/stat.h:19,
                    from include/linux/module.h:13,
                    from drivers/net/ethernet/intel/ice/ice.h:10,
                    from drivers/net/ethernet/intel/ice/ice_lib.h:7,
                    from drivers/net/ethernet/intel/ice/ice_switch.c:4:
   drivers/net/ethernet/intel/ice/ice_switch.c: In function 'ice_find_free_recp_res_idx.constprop':
>> include/linux/bitmap.h:447:22: warning: 'possible_idx[0]' is used uninitialized [-Wuninitialized]
     447 |                 *map |= GENMASK(start + nbits - 1, start);
         |                      ^~
   In file included from drivers/net/ethernet/intel/ice/ice.h:7,
                    from drivers/net/ethernet/intel/ice/ice_lib.h:7,
                    from drivers/net/ethernet/intel/ice/ice_switch.c:4:
   drivers/net/ethernet/intel/ice/ice_switch.c:4929:24: note: 'possible_idx[0]' was declared here
    4929 |         DECLARE_BITMAP(possible_idx, ICE_MAX_FV_WORDS);
         |                        ^~~~~~~~~~~~
   include/linux/types.h:11:23: note: in definition of macro 'DECLARE_BITMAP'
      11 |         unsigned long name[BITS_TO_LONGS(bits)]
         |                       ^~~~


vim +447 include/linux/bitmap.h

   440	
   441	static __always_inline void bitmap_set(unsigned long *map, unsigned int start,
   442			unsigned int nbits)
   443	{
   444		if (__builtin_constant_p(nbits) && nbits == 1)
   445			__set_bit(start, map);
   446		else if (small_const_nbits(start + nbits))
 > 447			*map |= GENMASK(start + nbits - 1, start);
   448		else if (__builtin_constant_p(start & BITMAP_MEM_MASK) &&
   449			 IS_ALIGNED(start, BITMAP_MEM_ALIGNMENT) &&
   450			 __builtin_constant_p(nbits & BITMAP_MEM_MASK) &&
   451			 IS_ALIGNED(nbits, BITMAP_MEM_ALIGNMENT))
   452			memset((char *)map + start / 8, 0xff, nbits / 8);
   453		else
   454			__bitmap_set(map, start, nbits);
   455	}
   456	

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

                 reply	other threads:[~2022-06-22  7:25 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=202206221502.VUxmhVnV-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alexandr.lobakin@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®