linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [pci:wip/2508-david-aspm-api 1/2] drivers/firewire/ohci.c:745:36: warning: implicit conversion from 'unsigned long' to '__u16' (aka 'unsigned short') changes value from 65536 to 0
@ 2025-08-27  3:59 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-08-27  3:59 UTC (permalink / raw)
  To: David E. Box
  Cc: llvm, oe-kbuild-all, linux-pci, Bjorn Helgaas,
	Rafael J. Wysocki (Intel)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git wip/2508-david-aspm-api
head:   a373462082599403e030c605ff260fd45429fe66
commit: 5ea26ba40d978b9f34faec2ca92c60e6d9db11c5 [1/2] PCI/ASPM: Add pci_host_set_default_pcie_link_state()
config: arm64-randconfig-003-20250827 (https://download.01.org/0day-ci/archive/20250827/202508271142.h1iibk0C-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project d26ea02060b1c9db751d188b2edb0059a9eb273d)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250827/202508271142.h1iibk0C-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/202508271142.h1iibk0C-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/linux/ftrace.h:23:
   In file included from arch/arm64/include/asm/ftrace.h:41:
   include/linux/compat.h:454:10: warning: array index 7 is past the end of the array (that has type 'compat_sigset_word[2]' (aka 'unsigned int[2]')) [-Warray-bounds]
     454 |         case 4: v.sig[7] = (set->sig[3] >> 32); v.sig[6] = set->sig[3];
         |                 ^     ~
   include/linux/compat.h:130:2: note: array 'sig' declared here
     130 |         compat_sigset_word      sig[_COMPAT_NSIG_WORDS];
         |         ^
   include/linux/compat.h:454:42: warning: array index 6 is past the end of the array (that has type 'compat_sigset_word[2]' (aka 'unsigned int[2]')) [-Warray-bounds]
     454 |         case 4: v.sig[7] = (set->sig[3] >> 32); v.sig[6] = set->sig[3];
         |                                                 ^     ~
   include/linux/compat.h:130:2: note: array 'sig' declared here
     130 |         compat_sigset_word      sig[_COMPAT_NSIG_WORDS];
         |         ^
   include/linux/compat.h:454:53: warning: array index 3 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds]
     454 |         case 4: v.sig[7] = (set->sig[3] >> 32); v.sig[6] = set->sig[3];
         |                                                            ^        ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from drivers/firewire/ohci.c:51:
   In file included from include/trace/events/firewire_ohci.h:101:
   In file included from include/trace/define_trace.h:132:
   In file included from include/trace/trace_events.h:21:
   In file included from include/linux/trace_events.h:10:
   In file included from include/linux/perf_event.h:43:
   In file included from include/linux/ftrace.h:23:
   In file included from arch/arm64/include/asm/ftrace.h:41:
   include/linux/compat.h:456:22: warning: array index 2 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds]
     456 |         case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2];
         |                             ^        ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from drivers/firewire/ohci.c:51:
   In file included from include/trace/events/firewire_ohci.h:101:
   In file included from include/trace/define_trace.h:132:
   In file included from include/trace/trace_events.h:21:
   In file included from include/linux/trace_events.h:10:
   In file included from include/linux/perf_event.h:43:
   In file included from include/linux/ftrace.h:23:
   In file included from arch/arm64/include/asm/ftrace.h:41:
   include/linux/compat.h:456:10: warning: array index 5 is past the end of the array (that has type 'compat_sigset_word[2]' (aka 'unsigned int[2]')) [-Warray-bounds]
     456 |         case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2];
         |                 ^     ~
   include/linux/compat.h:130:2: note: array 'sig' declared here
     130 |         compat_sigset_word      sig[_COMPAT_NSIG_WORDS];
         |         ^
   include/linux/compat.h:456:42: warning: array index 4 is past the end of the array (that has type 'compat_sigset_word[2]' (aka 'unsigned int[2]')) [-Warray-bounds]
     456 |         case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2];
         |                                                 ^     ~
   include/linux/compat.h:130:2: note: array 'sig' declared here
     130 |         compat_sigset_word      sig[_COMPAT_NSIG_WORDS];
         |         ^
   include/linux/compat.h:456:53: warning: array index 2 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds]
     456 |         case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2];
         |                                                            ^        ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from drivers/firewire/ohci.c:51:
   In file included from include/trace/events/firewire_ohci.h:101:
   In file included from include/trace/define_trace.h:132:
   In file included from include/trace/trace_events.h:21:
   In file included from include/linux/trace_events.h:10:
   In file included from include/linux/perf_event.h:43:
   In file included from include/linux/ftrace.h:23:
   In file included from arch/arm64/include/asm/ftrace.h:41:
   include/linux/compat.h:458:22: warning: array index 1 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds]
     458 |         case 2: v.sig[3] = (set->sig[1] >> 32); v.sig[2] = set->sig[1];
         |                             ^        ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from drivers/firewire/ohci.c:51:
   In file included from include/trace/events/firewire_ohci.h:101:
   In file included from include/trace/define_trace.h:132:
   In file included from include/trace/trace_events.h:21:
   In file included from include/linux/trace_events.h:10:
   In file included from include/linux/perf_event.h:43:
   In file included from include/linux/ftrace.h:23:
   In file included from arch/arm64/include/asm/ftrace.h:41:
   include/linux/compat.h:458:10: warning: array index 3 is past the end of the array (that has type 'compat_sigset_word[2]' (aka 'unsigned int[2]')) [-Warray-bounds]
     458 |         case 2: v.sig[3] = (set->sig[1] >> 32); v.sig[2] = set->sig[1];
         |                 ^     ~
   include/linux/compat.h:130:2: note: array 'sig' declared here
     130 |         compat_sigset_word      sig[_COMPAT_NSIG_WORDS];
         |         ^
   include/linux/compat.h:458:42: warning: array index 2 is past the end of the array (that has type 'compat_sigset_word[2]' (aka 'unsigned int[2]')) [-Warray-bounds]
     458 |         case 2: v.sig[3] = (set->sig[1] >> 32); v.sig[2] = set->sig[1];
         |                                                 ^     ~
   include/linux/compat.h:130:2: note: array 'sig' declared here
     130 |         compat_sigset_word      sig[_COMPAT_NSIG_WORDS];
         |         ^
   include/linux/compat.h:458:53: warning: array index 1 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds]
     458 |         case 2: v.sig[3] = (set->sig[1] >> 32); v.sig[2] = set->sig[1];
         |                                                            ^        ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
>> drivers/firewire/ohci.c:745:36: warning: implicit conversion from 'unsigned long' to '__u16' (aka 'unsigned short') changes value from 65536 to 0 [-Wconstant-conversion]
     745 |         d->res_count       =  cpu_to_le16(PAGE_SIZE);
         |                               ~~~~~~~~~~~~^~~~~~~~~~
   include/vdso/page.h:15:30: note: expanded from macro 'PAGE_SIZE'
      15 | #define PAGE_SIZE       (_AC(1,UL) << CONFIG_PAGE_SHIFT)
         |                                    ^
   include/uapi/linux/byteorder/big_endian.h:36:53: note: expanded from macro '__cpu_to_le16'
      36 | #define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
         |                                           ~~~~~~~~~~^~~
   include/uapi/linux/swab.h:107:12: note: expanded from macro '__swab16'
     107 |         __fswab16(x))
         |         ~~~~~~~~~ ^
   drivers/firewire/ohci.c:821:37: warning: implicit conversion from 'unsigned long' to '__u16' (aka 'unsigned short') changes value from 65536 to 0 [-Wconstant-conversion]
     821 |                 if (next_res_count == cpu_to_le16(PAGE_SIZE)) {
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
   include/vdso/page.h:15:30: note: expanded from macro 'PAGE_SIZE'
      15 | #define PAGE_SIZE       (_AC(1,UL) << CONFIG_PAGE_SHIFT)
         |                                    ^
   include/uapi/linux/byteorder/big_endian.h:36:53: note: expanded from macro '__cpu_to_le16'
      36 | #define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
         |                                           ~~~~~~~~~~^~~
   include/uapi/linux/swab.h:107:12: note: expanded from macro '__swab16'
     107 |         __fswab16(x))
         |         ~~~~~~~~~ ^
   include/linux/compiler.h:55:47: note: expanded from macro 'if'
      55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
         |                            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:57:86: note: expanded from macro '__trace_if_var'
      57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                                     ~~~~~~~~~~~~~~~~~^~~~~
   include/linux/compiler.h:68:3: note: expanded from macro '__trace_if_value'
      68 |         (cond) ?                                        \
         |          ^~~~
   drivers/firewire/ohci.c:821:37: warning: implicit conversion from 'unsigned long' to '__u16' (aka 'unsigned short') changes value from 65536 to 0 [-Wconstant-conversion]
     821 |                 if (next_res_count == cpu_to_le16(PAGE_SIZE)) {
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
   include/vdso/page.h:15:30: note: expanded from macro 'PAGE_SIZE'
      15 | #define PAGE_SIZE       (_AC(1,UL) << CONFIG_PAGE_SHIFT)
         |                                    ^
   include/uapi/linux/byteorder/big_endian.h:36:53: note: expanded from macro '__cpu_to_le16'
      36 | #define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
         |                                           ~~~~~~~~~~^~~
   include/uapi/linux/swab.h:107:12: note: expanded from macro '__swab16'
     107 |         __fswab16(x))
         |         ~~~~~~~~~ ^
   include/linux/compiler.h:55:47: note: expanded from macro 'if'
      55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
         |                            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:57:52: note: expanded from macro '__trace_if_var'
      57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                    ^~~~
   drivers/firewire/ohci.c:821:37: warning: implicit conversion from 'unsigned long' to '__u16' (aka 'unsigned short') changes value from 65536 to 0 [-Wconstant-conversion]
     821 |                 if (next_res_count == cpu_to_le16(PAGE_SIZE)) {
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
   include/vdso/page.h:15:30: note: expanded from macro 'PAGE_SIZE'
      15 | #define PAGE_SIZE       (_AC(1,UL) << CONFIG_PAGE_SHIFT)
         |                                    ^
   include/uapi/linux/byteorder/big_endian.h:36:53: note: expanded from macro '__cpu_to_le16'
      36 | #define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
         |                                           ~~~~~~~~~~^~~
   include/uapi/linux/swab.h:107:12: note: expanded from macro '__swab16'
     107 |         __fswab16(x))
         |         ~~~~~~~~~ ^
   include/linux/compiler.h:55:47: note: expanded from macro 'if'
      55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
         |                            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:57:61: note: expanded from macro '__trace_if_var'
      57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                             ^~~~
   drivers/firewire/ohci.c:833:39: warning: implicit conversion from 'unsigned long' to '__u16' (aka 'unsigned short') changes value from 65536 to 0 [-Wconstant-conversion]
     833 |                                 if (next_res_count != cpu_to_le16(PAGE_SIZE))
         |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
   include/vdso/page.h:15:30: note: expanded from macro 'PAGE_SIZE'
      15 | #define PAGE_SIZE       (_AC(1,UL) << CONFIG_PAGE_SHIFT)
         |                                    ^
   include/uapi/linux/byteorder/big_endian.h:36:53: note: expanded from macro '__cpu_to_le16'
      36 | #define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
         |                                           ~~~~~~~~~~^~~
   include/uapi/linux/swab.h:107:12: note: expanded from macro '__swab16'
     107 |         __fswab16(x))
         |         ~~~~~~~~~ ^
   include/linux/compiler.h:55:47: note: expanded from macro 'if'
      55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
         |                            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:57:86: note: expanded from macro '__trace_if_var'
      57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                                     ~~~~~~~~~~~~~~~~~^~~~~
   include/linux/compiler.h:68:3: note: expanded from macro '__trace_if_value'
      68 |         (cond) ?                                        \
         |          ^~~~
   drivers/firewire/ohci.c:833:39: warning: implicit conversion from 'unsigned long' to '__u16' (aka 'unsigned short') changes value from 65536 to 0 [-Wconstant-conversion]
     833 |                                 if (next_res_count != cpu_to_le16(PAGE_SIZE))
         |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
   include/vdso/page.h:15:30: note: expanded from macro 'PAGE_SIZE'
      15 | #define PAGE_SIZE       (_AC(1,UL) << CONFIG_PAGE_SHIFT)
         |                                    ^
   include/uapi/linux/byteorder/big_endian.h:36:53: note: expanded from macro '__cpu_to_le16'
      36 | #define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
         |                                           ~~~~~~~~~~^~~
   include/uapi/linux/swab.h:107:12: note: expanded from macro '__swab16'
     107 |         __fswab16(x))


vim +745 drivers/firewire/ohci.c

32b46093a07698 drivers/firewire/fw-ohci.c Kristian Høgsberg 2007-02-06  738  
7a39d8b8216546 drivers/firewire/ohci.c    Clemens Ladisch   2010-11-26  739  static void ar_context_link_page(struct ar_context *ctx, unsigned int index)
7a39d8b8216546 drivers/firewire/ohci.c    Clemens Ladisch   2010-11-26  740  {
7a39d8b8216546 drivers/firewire/ohci.c    Clemens Ladisch   2010-11-26  741  	struct descriptor *d;
7a39d8b8216546 drivers/firewire/ohci.c    Clemens Ladisch   2010-11-26  742  
7a39d8b8216546 drivers/firewire/ohci.c    Clemens Ladisch   2010-11-26  743  	d = &ctx->descriptors[index];
7a39d8b8216546 drivers/firewire/ohci.c    Clemens Ladisch   2010-11-26  744  	d->branch_address  &= cpu_to_le32(~0xf);
7a39d8b8216546 drivers/firewire/ohci.c    Clemens Ladisch   2010-11-26 @745  	d->res_count       =  cpu_to_le16(PAGE_SIZE);
7a39d8b8216546 drivers/firewire/ohci.c    Clemens Ladisch   2010-11-26  746  	d->transfer_status =  0;
32b46093a07698 drivers/firewire/fw-ohci.c Kristian Høgsberg 2007-02-06  747  
071595ebdc66d7 drivers/firewire/ohci.c    Stefan Richter    2010-07-27  748  	wmb(); /* finish init of new descriptors before branch_address update */
7a39d8b8216546 drivers/firewire/ohci.c    Clemens Ladisch   2010-11-26  749  	d = &ctx->descriptors[ctx->last_buffer_index];
7a39d8b8216546 drivers/firewire/ohci.c    Clemens Ladisch   2010-11-26  750  	d->branch_address  |= cpu_to_le32(1);
7a39d8b8216546 drivers/firewire/ohci.c    Clemens Ladisch   2010-11-26  751  
7a39d8b8216546 drivers/firewire/ohci.c    Clemens Ladisch   2010-11-26  752  	ctx->last_buffer_index = index;
32b46093a07698 drivers/firewire/fw-ohci.c Kristian Høgsberg 2007-02-06  753  
a77754a75d58d5 drivers/firewire/fw-ohci.c Kristian Høgsberg 2007-05-07  754  	reg_write(ctx->ohci, CONTROL_SET(ctx->regs), CONTEXT_WAKE);
837596a61ba8f9 drivers/firewire/ohci.c    Clemens Ladisch   2010-10-25  755  }
837596a61ba8f9 drivers/firewire/ohci.c    Clemens Ladisch   2010-10-25  756  

:::::: The code at line 745 was first introduced by commit
:::::: 7a39d8b82165462729d09066bddb395a19025acd firewire: ohci: Asynchronous Reception rewrite

:::::: TO: Clemens Ladisch <clemens@ladisch.de>
:::::: CC: Stefan Richter <stefanr@s5r6.in-berlin.de>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-08-27  4:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-27  3:59 [pci:wip/2508-david-aspm-api 1/2] drivers/firewire/ohci.c:745:36: warning: implicit conversion from 'unsigned long' to '__u16' (aka 'unsigned short') changes value from 65536 to 0 kernel test robot

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).