* [cxl:next 1/1] drivers/cxl/core/pci.c:1103:9: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((base), char: (unsigned char)0, unsigned char: (unsigned char)0, signed char: (unsigned char)0, unsigned short: (unsign...
@ 2025-02-03 20:13 kernel test robot
2025-02-04 15:13 ` Dave Jiang
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2025-02-03 20:13 UTC (permalink / raw)
To: Davidlohr Bueso
Cc: oe-kbuild-all, Alison Schofield, Vishal Verma, Ira Weiny,
Dan Williams, linux-cxl, Dave Jiang, Jonathan Cameron
tree: https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git next
head: 0fd158c1ea0cc70434a52b4b812cbec4579b9f66
commit: 0fd158c1ea0cc70434a52b4b812cbec4579b9f66 [1/1] cxl/pci: Support Global Persistent Flush (GPF)
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20250204/202502040454.Jtb55wW7-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250204/202502040454.Jtb55wW7-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/202502040454.Jtb55wW7-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/cxl/core/pci.c:7:
In file included from include/linux/pci.h:1660:
In file included from include/linux/dmapool.h:14:
In file included from include/linux/scatterlist.h:8:
In file included from include/linux/mm.h:2224:
include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
504 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
505 | item];
| ~~~~
include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
511 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
512 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
524 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
525 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/cxl/core/pci.c:1103:9: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((base), char: (unsigned char)0, unsigned char: (unsigned char)0, signed char: (unsigned char)0, unsigned short: (unsigned short)0, short: (unsigned short)0, unsigned int: (unsigned int)0, int: (unsigned int)0, unsigned long: (unsigned long)0, long: (unsigned long)0, unsigned long long: (unsigned long long)0, long long: (unsigned long long)0, default: (base)))' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
1103 | ctrl = FIELD_PREP(base, GPF_TIMEOUT_BASE_MAX);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:115:3: note: expanded from macro 'FIELD_PREP'
115 | __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:72:53: note: expanded from macro '__BF_FIELD_CHECK'
72 | BUILD_BUG_ON_MSG(__bf_cast_unsigned(_mask, _mask) > \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
73 | __bf_cast_unsigned(_reg, ~0ull), \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74 | _pfx "type of reg too small for mask"); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_ON_MSG'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
include/linux/compiler_types.h:542:22: note: expanded from macro 'compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:530:23: note: expanded from macro '_compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:522:9: note: expanded from macro '__compiletime_assert'
522 | if (!(condition)) \
| ^~~~~~~~~
>> drivers/cxl/core/pci.c:1104:10: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((scale), char: (unsigned char)0, unsigned char: (unsigned char)0, signed char: (unsigned char)0, unsigned short: (unsigned short)0, short: (unsigned short)0, unsigned int: (unsigned int)0, int: (unsigned int)0, unsigned long: (unsigned long)0, long: (unsigned long)0, unsigned long long: (unsigned long long)0, long long: (unsigned long long)0, default: (scale)))' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
1104 | ctrl |= FIELD_PREP(scale, GPF_TIMEOUT_SCALE_MAX);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:115:3: note: expanded from macro 'FIELD_PREP'
115 | __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:72:53: note: expanded from macro '__BF_FIELD_CHECK'
72 | BUILD_BUG_ON_MSG(__bf_cast_unsigned(_mask, _mask) > \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
73 | __bf_cast_unsigned(_reg, ~0ull), \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74 | _pfx "type of reg too small for mask"); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_ON_MSG'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
include/linux/compiler_types.h:542:22: note: expanded from macro 'compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:530:23: note: expanded from macro '_compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:522:9: note: expanded from macro '__compiletime_assert'
522 | if (!(condition)) \
| ^~~~~~~~~
5 warnings generated.
vim +1103 drivers/cxl/core/pci.c
1074
1075 static int update_gpf_port_dvsec(struct pci_dev *pdev, int dvsec, int phase)
1076 {
1077 u16 ctrl;
1078 int rc, offset, base, scale;
1079
1080 switch (phase) {
1081 case 1:
1082 offset = CXL_DVSEC_PORT_GPF_PHASE_1_CONTROL_OFFSET;
1083 base = CXL_DVSEC_PORT_GPF_PHASE_1_TMO_BASE_MASK;
1084 scale = CXL_DVSEC_PORT_GPF_PHASE_1_TMO_SCALE_MASK;
1085 break;
1086 case 2:
1087 offset = CXL_DVSEC_PORT_GPF_PHASE_2_CONTROL_OFFSET;
1088 base = CXL_DVSEC_PORT_GPF_PHASE_2_TMO_BASE_MASK;
1089 scale = CXL_DVSEC_PORT_GPF_PHASE_2_TMO_SCALE_MASK;
1090 break;
1091 default:
1092 return -EINVAL;
1093 }
1094
1095 rc = pci_read_config_word(pdev, dvsec + offset, &ctrl);
1096 if (rc)
1097 return rc;
1098
1099 if (FIELD_GET(base, ctrl) == GPF_TIMEOUT_BASE_MAX &&
1100 FIELD_GET(scale, ctrl) == GPF_TIMEOUT_SCALE_MAX)
1101 return 0;
1102
> 1103 ctrl = FIELD_PREP(base, GPF_TIMEOUT_BASE_MAX);
> 1104 ctrl |= FIELD_PREP(scale, GPF_TIMEOUT_SCALE_MAX);
1105
1106 rc = pci_write_config_word(pdev, dvsec + offset, ctrl);
1107 if (!rc)
1108 pci_dbg(pdev, "Port GPF phase %d timeout: %d0 secs\n",
1109 phase, GPF_TIMEOUT_BASE_MAX);
1110
1111 return rc;
1112 }
1113
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [cxl:next 1/1] drivers/cxl/core/pci.c:1103:9: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((base), char: (unsigned char)0, unsigned char: (unsigned char)0, signed char: (unsigned char)0, unsigned short: (unsign...
2025-02-03 20:13 [cxl:next 1/1] drivers/cxl/core/pci.c:1103:9: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((base), char: (unsigned char)0, unsigned char: (unsigned char)0, signed char: (unsigned char)0, unsigned short: (unsign kernel test robot
@ 2025-02-04 15:13 ` Dave Jiang
0 siblings, 0 replies; 2+ messages in thread
From: Dave Jiang @ 2025-02-04 15:13 UTC (permalink / raw)
To: kernel test robot, Davidlohr Bueso
Cc: oe-kbuild-all, Alison Schofield, Vishal Verma, Ira Weiny,
Dan Williams, linux-cxl, Jonathan Cameron
On 2/3/25 1:13 PM, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git next
> head: 0fd158c1ea0cc70434a52b4b812cbec4579b9f66
> commit: 0fd158c1ea0cc70434a52b4b812cbec4579b9f66 [1/1] cxl/pci: Support Global Persistent Flush (GPF)
> config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20250204/202502040454.Jtb55wW7-lkp@intel.com/config)
> compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250204/202502040454.Jtb55wW7-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/202502040454.Jtb55wW7-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
> In file included from drivers/cxl/core/pci.c:7:
> In file included from include/linux/pci.h:1660:
> In file included from include/linux/dmapool.h:14:
> In file included from include/linux/scatterlist.h:8:
> In file included from include/linux/mm.h:2224:
> include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
> 504 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
> | ~~~~~~~~~~~~~~~~~~~~~ ^
> 505 | item];
> | ~~~~
> include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
> 511 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
> | ~~~~~~~~~~~~~~~~~~~~~ ^
> 512 | NR_VM_NUMA_EVENT_ITEMS +
> | ~~~~~~~~~~~~~~~~~~~~~~
> include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
> 524 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
> | ~~~~~~~~~~~~~~~~~~~~~ ^
> 525 | NR_VM_NUMA_EVENT_ITEMS +
> | ~~~~~~~~~~~~~~~~~~~~~~
>>> drivers/cxl/core/pci.c:1103:9: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((base), char: (unsigned char)0, unsigned char: (unsigned char)0, signed char: (unsigned char)0, unsigned short: (unsigned short)0, short: (unsigned short)0, unsigned int: (unsigned int)0, int: (unsigned int)0, unsigned long: (unsigned long)0, long: (unsigned long)0, unsigned long long: (unsigned long long)0, long long: (unsigned long long)0, default: (base)))' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
> 1103 | ctrl = FIELD_PREP(base, GPF_TIMEOUT_BASE_MAX);
Davidlohr,
It looks like setting 'base' and 'scale' to u64 quiets the compiler warning. Do you see any issues with that?
DJ
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/bitfield.h:115:3: note: expanded from macro 'FIELD_PREP'
> 115 | __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/bitfield.h:72:53: note: expanded from macro '__BF_FIELD_CHECK'
> 72 | BUILD_BUG_ON_MSG(__bf_cast_unsigned(_mask, _mask) > \
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
> 73 | __bf_cast_unsigned(_reg, ~0ull), \
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 74 | _pfx "type of reg too small for mask"); \
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_ON_MSG'
> 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
> | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
> include/linux/compiler_types.h:542:22: note: expanded from macro 'compiletime_assert'
> 542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
> | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/compiler_types.h:530:23: note: expanded from macro '_compiletime_assert'
> 530 | __compiletime_assert(condition, msg, prefix, suffix)
> | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/compiler_types.h:522:9: note: expanded from macro '__compiletime_assert'
> 522 | if (!(condition)) \
> | ^~~~~~~~~
>>> drivers/cxl/core/pci.c:1104:10: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((scale), char: (unsigned char)0, unsigned char: (unsigned char)0, signed char: (unsigned char)0, unsigned short: (unsigned short)0, short: (unsigned short)0, unsigned int: (unsigned int)0, int: (unsigned int)0, unsigned long: (unsigned long)0, long: (unsigned long)0, unsigned long long: (unsigned long long)0, long long: (unsigned long long)0, default: (scale)))' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
> 1104 | ctrl |= FIELD_PREP(scale, GPF_TIMEOUT_SCALE_MAX);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/bitfield.h:115:3: note: expanded from macro 'FIELD_PREP'
> 115 | __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/bitfield.h:72:53: note: expanded from macro '__BF_FIELD_CHECK'
> 72 | BUILD_BUG_ON_MSG(__bf_cast_unsigned(_mask, _mask) > \
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
> 73 | __bf_cast_unsigned(_reg, ~0ull), \
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 74 | _pfx "type of reg too small for mask"); \
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_ON_MSG'
> 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
> | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
> include/linux/compiler_types.h:542:22: note: expanded from macro 'compiletime_assert'
> 542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
> | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/compiler_types.h:530:23: note: expanded from macro '_compiletime_assert'
> 530 | __compiletime_assert(condition, msg, prefix, suffix)
> | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/compiler_types.h:522:9: note: expanded from macro '__compiletime_assert'
> 522 | if (!(condition)) \
> | ^~~~~~~~~
> 5 warnings generated.
>
>
> vim +1103 drivers/cxl/core/pci.c
>
> 1074
> 1075 static int update_gpf_port_dvsec(struct pci_dev *pdev, int dvsec, int phase)
> 1076 {
> 1077 u16 ctrl;
> 1078 int rc, offset, base, scale;
> 1079
> 1080 switch (phase) {
> 1081 case 1:
> 1082 offset = CXL_DVSEC_PORT_GPF_PHASE_1_CONTROL_OFFSET;
> 1083 base = CXL_DVSEC_PORT_GPF_PHASE_1_TMO_BASE_MASK;
> 1084 scale = CXL_DVSEC_PORT_GPF_PHASE_1_TMO_SCALE_MASK;
> 1085 break;
> 1086 case 2:
> 1087 offset = CXL_DVSEC_PORT_GPF_PHASE_2_CONTROL_OFFSET;
> 1088 base = CXL_DVSEC_PORT_GPF_PHASE_2_TMO_BASE_MASK;
> 1089 scale = CXL_DVSEC_PORT_GPF_PHASE_2_TMO_SCALE_MASK;
> 1090 break;
> 1091 default:
> 1092 return -EINVAL;
> 1093 }
> 1094
> 1095 rc = pci_read_config_word(pdev, dvsec + offset, &ctrl);
> 1096 if (rc)
> 1097 return rc;
> 1098
> 1099 if (FIELD_GET(base, ctrl) == GPF_TIMEOUT_BASE_MAX &&
> 1100 FIELD_GET(scale, ctrl) == GPF_TIMEOUT_SCALE_MAX)
> 1101 return 0;
> 1102
>> 1103 ctrl = FIELD_PREP(base, GPF_TIMEOUT_BASE_MAX);
>> 1104 ctrl |= FIELD_PREP(scale, GPF_TIMEOUT_SCALE_MAX);
> 1105
> 1106 rc = pci_write_config_word(pdev, dvsec + offset, ctrl);
> 1107 if (!rc)
> 1108 pci_dbg(pdev, "Port GPF phase %d timeout: %d0 secs\n",
> 1109 phase, GPF_TIMEOUT_BASE_MAX);
> 1110
> 1111 return rc;
> 1112 }
> 1113
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-04 15:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-03 20:13 [cxl:next 1/1] drivers/cxl/core/pci.c:1103:9: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((base), char: (unsigned char)0, unsigned char: (unsigned char)0, signed char: (unsigned char)0, unsigned short: (unsign kernel test robot
2025-02-04 15:13 ` Dave Jiang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox