public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Anshul Dalal <anshulusr@gmail.com>,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev,
	"Anshul Dalal" <anshulusr@gmail.com>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	linux-kernel-mentees@lists.linuxfoundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 2/2] input: joystick: driver for Adafruit Seesaw Gamepad
Date: Thu, 19 Oct 2023 08:10:54 +0800	[thread overview]
Message-ID: <202310190852.BCw4Ry7D-lkp@intel.com> (raw)
In-Reply-To: <20231017034356.1436677-2-anshulusr@gmail.com>

Hi Anshul,

kernel test robot noticed the following build warnings:

[auto build test WARNING on dtor-input/next]
[also build test WARNING on dtor-input/for-linus hid/for-next linus/master v6.6-rc6 next-20231018]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Anshul-Dalal/input-joystick-driver-for-Adafruit-Seesaw-Gamepad/20231017-160635
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
patch link:    https://lore.kernel.org/r/20231017034356.1436677-2-anshulusr%40gmail.com
patch subject: [PATCH v5 2/2] input: joystick: driver for Adafruit Seesaw Gamepad
config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/20231019/202310190852.BCw4Ry7D-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231019/202310190852.BCw4Ry7D-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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310190852.BCw4Ry7D-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/linux/thread_info.h:27,
                    from arch/sparc/include/asm/current.h:15,
                    from include/linux/sched.h:12,
                    from include/linux/delay.h:23,
                    from drivers/input/joystick/adafruit-seesaw.c:17:
   drivers/input/joystick/adafruit-seesaw.c: In function 'seesaw_read_data':
>> include/linux/bitops.h:52:11: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'u32[1]' {aka 'unsigned int[1]'} [-Warray-bounds=]
      52 |           __builtin_constant_p(*(const unsigned long *)(addr))) ?       \
         |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/bitops.h:61:41: note: in expansion of macro 'bitop'
      61 | #define test_bit(nr, addr)              bitop(_test_bit, nr, addr)
         |                                         ^~~~~
   drivers/input/joystick/adafruit-seesaw.c:89:27: note: in expansion of macro 'test_bit'
      89 |         data->button_a = !test_bit(BUTTON_A, (long *)&result);
         |                           ^~~~~~~~
   drivers/input/joystick/adafruit-seesaw.c:87:13: note: object 'result' of size 4
      87 |         u32 result = get_unaligned_be32(&read_buf);
         |             ^~~~~~
   In file included from include/linux/bitops.h:34:
   In function 'generic_test_bit',
       inlined from 'seesaw_read_data' at drivers/input/joystick/adafruit-seesaw.c:89:20:
>> include/asm-generic/bitops/generic-non-atomic.h:128:27: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'u32[1]' {aka 'unsigned int[1]'} [-Warray-bounds=]
     128 |         return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
         |                       ~~~~^~~~~~~~~~~~~~
   drivers/input/joystick/adafruit-seesaw.c: In function 'seesaw_read_data':
   drivers/input/joystick/adafruit-seesaw.c:87:13: note: object 'result' of size 4
      87 |         u32 result = get_unaligned_be32(&read_buf);
         |             ^~~~~~
   In function 'generic_test_bit',
       inlined from 'seesaw_read_data' at drivers/input/joystick/adafruit-seesaw.c:90:20:
>> include/asm-generic/bitops/generic-non-atomic.h:128:27: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'u32[1]' {aka 'unsigned int[1]'} [-Warray-bounds=]
     128 |         return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
         |                       ~~~~^~~~~~~~~~~~~~
   drivers/input/joystick/adafruit-seesaw.c: In function 'seesaw_read_data':
   drivers/input/joystick/adafruit-seesaw.c:87:13: note: object 'result' of size 4
      87 |         u32 result = get_unaligned_be32(&read_buf);
         |             ^~~~~~
   In function 'generic_test_bit',
       inlined from 'seesaw_read_data' at drivers/input/joystick/adafruit-seesaw.c:91:20:
>> include/asm-generic/bitops/generic-non-atomic.h:128:27: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'u32[1]' {aka 'unsigned int[1]'} [-Warray-bounds=]
     128 |         return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
         |                       ~~~~^~~~~~~~~~~~~~
   drivers/input/joystick/adafruit-seesaw.c: In function 'seesaw_read_data':
   drivers/input/joystick/adafruit-seesaw.c:87:13: note: object 'result' of size 4
      87 |         u32 result = get_unaligned_be32(&read_buf);
         |             ^~~~~~
   In function 'generic_test_bit',
       inlined from 'seesaw_read_data' at drivers/input/joystick/adafruit-seesaw.c:92:20:
>> include/asm-generic/bitops/generic-non-atomic.h:128:27: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'u32[1]' {aka 'unsigned int[1]'} [-Warray-bounds=]
     128 |         return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
         |                       ~~~~^~~~~~~~~~~~~~
   drivers/input/joystick/adafruit-seesaw.c: In function 'seesaw_read_data':
   drivers/input/joystick/adafruit-seesaw.c:87:13: note: object 'result' of size 4
      87 |         u32 result = get_unaligned_be32(&read_buf);
         |             ^~~~~~
   In function 'generic_test_bit',
       inlined from 'seesaw_read_data' at drivers/input/joystick/adafruit-seesaw.c:93:24:
>> include/asm-generic/bitops/generic-non-atomic.h:128:27: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'u32[1]' {aka 'unsigned int[1]'} [-Warray-bounds=]
     128 |         return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
         |                       ~~~~^~~~~~~~~~~~~~
   drivers/input/joystick/adafruit-seesaw.c: In function 'seesaw_read_data':
   drivers/input/joystick/adafruit-seesaw.c:87:13: note: object 'result' of size 4
      87 |         u32 result = get_unaligned_be32(&read_buf);
         |             ^~~~~~
   In function 'generic_test_bit',
       inlined from 'seesaw_read_data' at drivers/input/joystick/adafruit-seesaw.c:94:25:
>> include/asm-generic/bitops/generic-non-atomic.h:128:27: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'u32[1]' {aka 'unsigned int[1]'} [-Warray-bounds=]
     128 |         return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
         |                       ~~~~^~~~~~~~~~~~~~
   drivers/input/joystick/adafruit-seesaw.c: In function 'seesaw_read_data':
   drivers/input/joystick/adafruit-seesaw.c:87:13: note: object 'result' of size 4
      87 |         u32 result = get_unaligned_be32(&read_buf);
         |             ^~~~~~


vim +52 include/linux/bitops.h

0e862838f29014 Alexander Lobakin 2022-06-24  35  
b03fc1173c0c2b Alexander Lobakin 2022-06-24  36  /*
b03fc1173c0c2b Alexander Lobakin 2022-06-24  37   * Many architecture-specific non-atomic bitops contain inline asm code and due
b03fc1173c0c2b Alexander Lobakin 2022-06-24  38   * to that the compiler can't optimize them to compile-time expressions or
b03fc1173c0c2b Alexander Lobakin 2022-06-24  39   * constants. In contrary, generic_*() helpers are defined in pure C and
b03fc1173c0c2b Alexander Lobakin 2022-06-24  40   * compilers optimize them just well.
b03fc1173c0c2b Alexander Lobakin 2022-06-24  41   * Therefore, to make `unsigned long foo = 0; __set_bit(BAR, &foo)` effectively
b03fc1173c0c2b Alexander Lobakin 2022-06-24  42   * equal to `unsigned long foo = BIT(BAR)`, pick the generic C alternative when
b03fc1173c0c2b Alexander Lobakin 2022-06-24  43   * the arguments can be resolved at compile time. That expression itself is a
b03fc1173c0c2b Alexander Lobakin 2022-06-24  44   * constant and doesn't bring any functional changes to the rest of cases.
b03fc1173c0c2b Alexander Lobakin 2022-06-24  45   * The casts to `uintptr_t` are needed to mitigate `-Waddress` warnings when
b03fc1173c0c2b Alexander Lobakin 2022-06-24  46   * passing a bitmap from .bss or .data (-> `!!addr` is always true).
b03fc1173c0c2b Alexander Lobakin 2022-06-24  47   */
e69eb9c460f128 Alexander Lobakin 2022-06-24  48  #define bitop(op, nr, addr)						\
b03fc1173c0c2b Alexander Lobakin 2022-06-24  49  	((__builtin_constant_p(nr) &&					\
b03fc1173c0c2b Alexander Lobakin 2022-06-24  50  	  __builtin_constant_p((uintptr_t)(addr) != (uintptr_t)NULL) &&	\
b03fc1173c0c2b Alexander Lobakin 2022-06-24  51  	  (uintptr_t)(addr) != (uintptr_t)NULL &&			\
b03fc1173c0c2b Alexander Lobakin 2022-06-24 @52  	  __builtin_constant_p(*(const unsigned long *)(addr))) ?	\
b03fc1173c0c2b Alexander Lobakin 2022-06-24  53  	 const##op(nr, addr) : op(nr, addr))
e69eb9c460f128 Alexander Lobakin 2022-06-24  54  

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

  reply	other threads:[~2023-10-19  0:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-17  3:43 [PATCH v5 1/2] dt-bindings: input: bindings for Adafruit Seesaw Gamepad Anshul Dalal
2023-10-17  3:43 ` [PATCH v5 2/2] input: joystick: driver " Anshul Dalal
2023-10-19  0:10   ` kernel test robot [this message]
2023-10-22 23:42   ` Jeff LaBundy
2023-10-23  5:55     ` Thomas Weißschuh 
2023-10-23 21:24       ` Jeff LaBundy
2023-10-24 15:56         ` Thomas Weißschuh 
2023-10-25 10:20     ` Anshul Dalal
2023-10-26  4:38       ` Jeff LaBundy
2023-10-22 23:47 ` [PATCH v5 1/2] dt-bindings: input: bindings " Jeff LaBundy
2023-10-23 11:58   ` Anshul Dalal
2023-10-23 18:53     ` Jeff LaBundy
  -- strict thread matches above, loose matches on Subject: below --
2023-10-12 16:27 Anshul Dalal
2023-10-12 16:27 ` [PATCH v5 2/2] input: joystick: driver " Anshul Dalal

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=202310190852.BCw4Ry7D-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=anshulusr@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=krzk@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=robh+dt@kernel.org \
    --cc=skhan@linuxfoundation.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