* [ukleinek:pwm/for-next 17/18] drivers/pwm/pwm-rcar.c:114:19: error: implicit declaration of function 'FIELD_MAX'
@ 2025-04-03 5:30 kernel test robot
2025-04-03 5:49 ` Uwe Kleine-König
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2025-04-03 5:30 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next
head: 4fe924e43a5aabe586ab696651c483c25a8a3abb
commit: edd549f4956be84ebd6a3900975544adeb0f3b50 [17/18] pwm: rcar: Improve register calculation
config: arc-randconfig-002-20250403 (https://download.01.org/0day-ci/archive/20250403/202504031354.VJtxScP5-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 12.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250403/202504031354.VJtxScP5-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/202504031354.VJtxScP5-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/pwm/pwm-rcar.c: In function 'rcar_pwm_set_counter':
>> drivers/pwm/pwm-rcar.c:114:19: error: implicit declaration of function 'FIELD_MAX' [-Werror=implicit-function-declaration]
114 | if (tmp > FIELD_MAX(RCAR_PWMCNT_CYC0_MASK))
| ^~~~~~~~~
>> drivers/pwm/pwm-rcar.c:117:15: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration]
117 | cyc = FIELD_PREP(RCAR_PWMCNT_CYC0_MASK, tmp);
| ^~~~~~~~~~
cc1: some warnings being treated as errors
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] 2+ messages in thread
* Re: [ukleinek:pwm/for-next 17/18] drivers/pwm/pwm-rcar.c:114:19: error: implicit declaration of function 'FIELD_MAX'
2025-04-03 5:30 [ukleinek:pwm/for-next 17/18] drivers/pwm/pwm-rcar.c:114:19: error: implicit declaration of function 'FIELD_MAX' kernel test robot
@ 2025-04-03 5:49 ` Uwe Kleine-König
0 siblings, 0 replies; 2+ messages in thread
From: Uwe Kleine-König @ 2025-04-03 5:49 UTC (permalink / raw)
To: kernel test robot; +Cc: oe-kbuild-all
[-- Attachment #1: Type: text/plain, Size: 1795 bytes --]
Hello,
On Thu, Apr 03, 2025 at 01:30:12PM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next
> head: 4fe924e43a5aabe586ab696651c483c25a8a3abb
> commit: edd549f4956be84ebd6a3900975544adeb0f3b50 [17/18] pwm: rcar: Improve register calculation
> config: arc-randconfig-002-20250403 (https://download.01.org/0day-ci/archive/20250403/202504031354.VJtxScP5-lkp@intel.com/config)
> compiler: arc-linux-gcc (GCC) 12.4.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250403/202504031354.VJtxScP5-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/202504031354.VJtxScP5-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
> drivers/pwm/pwm-rcar.c: In function 'rcar_pwm_set_counter':
> >> drivers/pwm/pwm-rcar.c:114:19: error: implicit declaration of function 'FIELD_MAX' [-Werror=implicit-function-declaration]
> 114 | if (tmp > FIELD_MAX(RCAR_PWMCNT_CYC0_MASK))
> | ^~~~~~~~~
> >> drivers/pwm/pwm-rcar.c:117:15: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration]
> 117 | cyc = FIELD_PREP(RCAR_PWMCNT_CYC0_MASK, tmp);
> | ^~~~~~~~~~
> cc1: some warnings being treated as errors
Thanks, I added an explicit #include <linux/bitfield.h> to the driver to
address this. This isn't needed on ARCH=arm because somewhere in the
#include jungle (here: arch/arm/include/asm/ptrace.h) this header is
pulled in..
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-03 5:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-03 5:30 [ukleinek:pwm/for-next 17/18] drivers/pwm/pwm-rcar.c:114:19: error: implicit declaration of function 'FIELD_MAX' kernel test robot
2025-04-03 5:49 ` Uwe Kleine-König
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.