public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [linux-next:master 14246/14442] drivers/pwm/pwm-rcar.c:114:12: error: call to undeclared function 'FIELD_MAX'; ISO C99 and later do not support implicit function declarations
@ 2025-04-03 11:55 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-04-03 11:55 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   f0a16f5363325cc8d9382471cdc7b654c53254c9
commit: edd549f4956be84ebd6a3900975544adeb0f3b50 [14246/14442] pwm: rcar: Improve register calculation
config: powerpc64-randconfig-003-20250403 (https://download.01.org/0day-ci/archive/20250403/202504032210.lrHoeR64-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 7eccafc3c84606587a175c0a8c1ebea6e4fb21cd)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250403/202504032210.lrHoeR64-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/202504032210.lrHoeR64-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/pwm/pwm-rcar.c:114:12: error: call to undeclared function 'FIELD_MAX'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     114 |         if (tmp > FIELD_MAX(RCAR_PWMCNT_CYC0_MASK))
         |                   ^
>> drivers/pwm/pwm-rcar.c:117:8: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     117 |         cyc = FIELD_PREP(RCAR_PWMCNT_CYC0_MASK, tmp);
         |               ^
   2 errors generated.


vim +/FIELD_MAX +114 drivers/pwm/pwm-rcar.c

   104	
   105	static int rcar_pwm_set_counter(struct rcar_pwm_chip *rp, int div, u64 duty_ns,
   106					u64 period_ns)
   107	{
   108		unsigned long long tmp;
   109		unsigned long clk_rate = clk_get_rate(rp->clk);
   110		u32 cyc, ph;
   111	
   112		/* div <= 24 == RCAR_PWM_MAX_DIVISION, so the shift doesn't overflow. */
   113		tmp = mul_u64_u64_div_u64(period_ns, clk_rate, (u64)NSEC_PER_SEC << div);
 > 114		if (tmp > FIELD_MAX(RCAR_PWMCNT_CYC0_MASK))
   115			tmp = FIELD_MAX(RCAR_PWMCNT_CYC0_MASK);
   116	
 > 117		cyc = FIELD_PREP(RCAR_PWMCNT_CYC0_MASK, tmp);
   118	
   119		tmp = mul_u64_u64_div_u64(duty_ns, clk_rate, (u64)NSEC_PER_SEC << div);
   120		if (tmp > FIELD_MAX(RCAR_PWMCNT_PH0_MASK))
   121			tmp = FIELD_MAX(RCAR_PWMCNT_PH0_MASK);
   122		ph = FIELD_PREP(RCAR_PWMCNT_PH0_MASK, tmp);
   123	
   124		/* Avoid prohibited setting */
   125		if (cyc == 0 || ph == 0)
   126			return -EINVAL;
   127	
   128		rcar_pwm_write(rp, cyc | ph, RCAR_PWMCNT);
   129	
   130		return 0;
   131	}
   132	

-- 
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-04-03 11:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-03 11:55 [linux-next:master 14246/14442] drivers/pwm/pwm-rcar.c:114:12: error: call to undeclared function 'FIELD_MAX'; ISO C99 and later do not support implicit function declarations 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