All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <rong.a.chen@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH 4/5] gpio: xilinx: Utilize generic bitmap_get_value and _set_value
Date: Tue, 29 Dec 2020 08:50:10 +0800	[thread overview]
Message-ID: <20201229005010.GA399595@shao2-debian> (raw)
In-Reply-To: <5041c8cfc423f046ca9cf4f8f0a8bd03552ab6ea.1608963095.git.syednwaris@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 6810 bytes --]

Hi Syed,

I love your patch! Perhaps something to improve:

[auto build test WARNING on bbe2ba04c5a92a49db8a42c850a5a2f6481e47eb]

url:    https://github.com/0day-ci/linux/commits/Syed-Nayyar-Waris/Introduce-the-for_each_set_clump-macro/20201226-144926
base:    bbe2ba04c5a92a49db8a42c850a5a2f6481e47eb
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago
config: mips-randconfig-s032-20201226 (attached as .config)
compiler: mips64-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-184-g1b896707-dirty
        # https://github.com/0day-ci/linux/commit/668f2f620cce361abead957de41153c84fbed6c9
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Syed-Nayyar-Waris/Introduce-the-for_each_set_clump-macro/20201226-144926
        git checkout 668f2f620cce361abead957de41153c84fbed6c9
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=mips 

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


"sparse warnings: (new ones prefixed by >>)"
   command-line: note: in included file:
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
   builtin:0:0: sparse: this was the original definition
   drivers/gpio/gpio-xilinx.c: note: in included file:
>> include/../drivers/gpio/clump_bits.h:48:30: sparse: sparse: invalid access past the end of 'new' (8 8)
   include/../drivers/gpio/clump_bits.h:49:63: sparse: sparse: shift too big (64) for type unsigned long

vim +/new +48 include/../drivers/gpio/clump_bits.h

d14f564f0d6c963 Syed Nayyar Waris 2020-12-26   5  
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26   6  /**
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26   7   * find_next_clump - find next clump with set bits in a memory region
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26   8   * @clump: location to store copy of found clump
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26   9   * @addr: address to base the search on
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  10   * @size: bitmap size in number of bits
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  11   * @offset: bit offset at which to start searching
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  12   * @clump_size: clump size in bits
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  13   *
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  14   * Returns the bit offset for the next set clump; the found clump value is
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  15   * copied to the location pointed by @clump. If no bits are set, returns @size.
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  16   */
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  17  extern unsigned long find_next_clump(unsigned long *clump,
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  18  				      const unsigned long *addr,
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  19  				      unsigned long size, unsigned long offset,
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  20  				      unsigned long clump_size);
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  21  
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  22  #define find_first_clump(clump, bits, size, clump_size) \
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  23  	find_next_clump((clump), (bits), (size), 0, (clump_size))
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  24  
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  25  /**
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  26   * bitmap_get_value - get a value of n-bits from the memory region
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  27   * @map: address to the bitmap memory region
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  28   * @start: bit offset of the n-bit value
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  29   * @nbits: size of value in bits (must be between 1 and BITS_PER_LONG inclusive).
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  30   *
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  31   * Returns value of nbits located at the @start bit offset within the @map
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  32   * memory region.
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  33   */
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  34  static inline unsigned long bitmap_get_value(const unsigned long *map,
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  35  					      unsigned long start,
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  36  					      unsigned long nbits)
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  37  {
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  38  	const size_t index = BIT_WORD(start);
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  39  	const unsigned long offset = start % BITS_PER_LONG;
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  40  	const unsigned long ceiling = round_up(start + 1, BITS_PER_LONG);
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  41  	const unsigned long space = ceiling - start;
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  42  	unsigned long value_low, value_high;
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  43  
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  44  	if (space >= nbits)
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  45  		return (map[index] >> offset) & GENMASK(nbits - 1, 0);
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  46  	else {
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  47  		value_low = map[index] & BITMAP_FIRST_WORD_MASK(start);
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26 @48  		value_high = map[index + 1] & BITMAP_LAST_WORD_MASK(start + nbits);
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  49  		return (value_low >> offset) | (value_high << space);
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  50  	}
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  51  }
d14f564f0d6c963 Syed Nayyar Waris 2020-12-26  52  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 26254 bytes --]

  parent reply	other threads:[~2020-12-29  0:50 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-26  6:41 [PATCH 0/5] Introduce the for_each_set_clump macro Syed Nayyar Waris
2020-12-26  6:41 ` Syed Nayyar Waris
2020-12-26  6:42 ` [PATCH 1/5] clump_bits: " Syed Nayyar Waris
2020-12-26  6:42   ` Syed Nayyar Waris
2020-12-27 22:03   ` Arnd Bergmann
2020-12-27 22:03     ` Arnd Bergmann
2020-12-28 12:10     ` William Breathitt Gray
2020-12-28 12:10       ` William Breathitt Gray
2020-12-26  6:43 ` [PATCH 2/5] lib/test_bitmap.c: Add for_each_set_clump test cases Syed Nayyar Waris
2020-12-26  6:43   ` Syed Nayyar Waris
2020-12-26 14:43   ` kernel test robot
2020-12-26 14:48   ` kernel test robot
2020-12-26 15:03   ` kernel test robot
     [not found]   ` <CAHp75VcSsfDKY3w4ufZktXzRB=GiObAV6voPfmeAHcbdwX0uqg@mail.gmail.com>
2021-02-04  8:55     ` Syed Nayyar Waris
2021-02-04  8:55       ` Syed Nayyar Waris
2021-02-07  4:18       ` Syed Nayyar Waris
2021-02-07  4:18         ` Syed Nayyar Waris
2020-12-26  6:43 ` [PATCH 3/5] gpio: thunderx: Utilize for_each_set_clump macro Syed Nayyar Waris
2020-12-26  6:43   ` Syed Nayyar Waris
2020-12-26 16:26   ` kernel test robot
2020-12-26 20:18   ` kernel test robot
2020-12-26  6:44 ` [PATCH 4/5] gpio: xilinx: Utilize generic bitmap_get_value and _set_value Syed Nayyar Waris
2020-12-26  6:44   ` Syed Nayyar Waris
2020-12-27 21:29   ` Linus Walleij
2020-12-27 21:29     ` Linus Walleij
2021-01-05 11:04     ` Michal Simek
2021-01-05 11:04       ` Michal Simek
2020-12-29  0:50   ` kernel test robot [this message]
2020-12-29  0:50   ` kernel test robot
2020-12-26  6:45 ` [PATCH 5/5] gpio: xilinx: Add extra check if sum of widths exceed 64 Syed Nayyar Waris
2020-12-26  6:45   ` Syed Nayyar Waris
2020-12-26  8:31   ` kernel test robot
2020-12-28 11:58   ` William Breathitt Gray
2020-12-28 11:58     ` William Breathitt Gray
2021-01-05 11:01   ` Michal Simek
2021-01-05 11:01     ` Michal Simek
2020-12-27 21:26 ` [PATCH 0/5] Introduce the for_each_set_clump macro Linus Walleij
2020-12-27 21:26   ` Linus Walleij
2021-01-05 14:19   ` Bartosz Golaszewski
2021-01-05 14:19     ` Bartosz Golaszewski
2021-01-05 14:39     ` Andy Shevchenko
2021-01-05 14:39       ` Andy Shevchenko
2021-01-06  7:27       ` Bartosz Golaszewski
2021-01-06  7:27         ` Bartosz Golaszewski
2021-01-06  8:19         ` William Breathitt Gray
2021-01-06  8:19           ` William Breathitt Gray
2021-01-05 11:09 ` Michal Simek
2021-01-05 11:09   ` Michal Simek
2020-12-26 15:13 [PATCH 4/5] gpio: xilinx: Utilize generic bitmap_get_value and _set_value kernel test robot
2020-12-26 15:24 kernel test robot

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=20201229005010.GA399595@shao2-debian \
    --to=rong.a.chen@intel.com \
    --cc=kbuild-all@lists.01.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 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.