Thread (1 message) 1 message, 1 author, 2025-10-28

Re: [PATCH v5 12/23] clk: at91: Convert to common field_{get,prep}() helpers

From: kernel test robot <hidden>
Date: 2025-10-28 06:02:49
Also in: llvm, oe-kbuild-all

Hi Geert,

kernel test robot noticed the following build warnings:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on next-20251027]
[cannot apply to clk/clk-next geert-renesas-devel/next geert-renesas-drivers/renesas-clk linus/master v6.18-rc3]
[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/Geert-Uytterhoeven/clk-at91-pmc-undef-field_-get-prep-before-definition/20251028-025423
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link:    https://lore.kernel.org/r/b9e9b7d94ba51c7bc028321a85e91adecb23f925.1761588465.git.geert%2Brenesas%40glider.be
patch subject: [PATCH v5 12/23] clk: at91: Convert to common field_{get,prep}() helpers
config: arm-randconfig-001-20251028 (https://download.01.org/0day-ci/archive/20251028/202510281335.UpSLYJG9-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project e1ae12640102fd2b05bc567243580f90acb1135f)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251028/202510281335.UpSLYJG9-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 [off-list ref]
| Closes: https://lore.kernel.org/oe-kbuild-all/202510281335.UpSLYJG9-lkp@intel.com/ (local)

All warnings (new ones prefixed by >>):
quoted
drivers/clk/at91/clk-peripheral.c:179:7: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((periph->layout->div_mask), 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: (periph->layout->div_mask)))' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
     179 |                            field_prep(periph->layout->div_mask, periph->div) |
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/bitfield.h:256:32: note: expanded from macro 'field_prep'
     256 |         (__builtin_constant_p(mask) ? FIELD_PREP(mask, val)             \
         |                                       ^~~~~~~~~~~~~~~~~~~~~
   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"); \
         |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:597:22: note: expanded from macro 'compiletime_assert'
     597 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:585:23: note: expanded from macro '_compiletime_assert'
     585 |         __compiletime_assert(condition, msg, prefix, suffix)
         |         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:577:9: note: expanded from macro '__compiletime_assert'
     577 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   1 warning generated.


vim +179 drivers/clk/at91/clk-peripheral.c

6114067e437eb8 Boris Brezillon   2013-10-11  163  
36971566ea7a51 Claudiu Beznea    2021-10-11  164  static int clk_sam9x5_peripheral_set(struct clk_sam9x5_peripheral *periph,
36971566ea7a51 Claudiu Beznea    2021-10-11  165  				     unsigned int status)
6114067e437eb8 Boris Brezillon   2013-10-11  166  {
1bdf02326b71ea Boris Brezillon   2014-09-07  167  	unsigned long flags;
36971566ea7a51 Claudiu Beznea    2021-10-11  168  	unsigned int enable = status ? AT91_PMC_PCR_EN : 0;
6114067e437eb8 Boris Brezillon   2013-10-11  169  
6114067e437eb8 Boris Brezillon   2013-10-11  170  	if (periph->id < PERIPHERAL_ID_MIN)
6114067e437eb8 Boris Brezillon   2013-10-11  171  		return 0;
6114067e437eb8 Boris Brezillon   2013-10-11  172  
1bdf02326b71ea Boris Brezillon   2014-09-07  173  	spin_lock_irqsave(periph->lock, flags);
cb4f4949b1c76f Alexandre Belloni 2019-04-02  174  	regmap_write(periph->regmap, periph->layout->offset,
cb4f4949b1c76f Alexandre Belloni 2019-04-02  175  		     (periph->id & periph->layout->pid_mask));
cb4f4949b1c76f Alexandre Belloni 2019-04-02  176  	regmap_update_bits(periph->regmap, periph->layout->offset,
cb4f4949b1c76f Alexandre Belloni 2019-04-02  177  			   periph->layout->div_mask | periph->layout->cmd |
36971566ea7a51 Claudiu Beznea    2021-10-11  178  			   enable,
cb4f4949b1c76f Alexandre Belloni 2019-04-02 @179  			   field_prep(periph->layout->div_mask, periph->div) |
36971566ea7a51 Claudiu Beznea    2021-10-11  180  			   periph->layout->cmd | enable);
1bdf02326b71ea Boris Brezillon   2014-09-07  181  	spin_unlock_irqrestore(periph->lock, flags);
1bdf02326b71ea Boris Brezillon   2014-09-07  182  
6114067e437eb8 Boris Brezillon   2013-10-11  183  	return 0;
6114067e437eb8 Boris Brezillon   2013-10-11  184  }
6114067e437eb8 Boris Brezillon   2013-10-11  185  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help