Re: [PATCH 2/2] clocksource/drivers: Add Realtek Otto timer driver

From: Sander Vanheule
Date: Mon Jan 17 2022 - 03:03:08 EST


On Mon, 2022-01-17 at 09:28 +0800, kernel test robot wrote:
>    drivers/clocksource/timer-realtek-otto.c: In function 'otto_tc_init':
>    drivers/clocksource/timer-realtek-otto.c:182:16: error: implicit
> declaration of function 'kzalloc'; did you mean 'd_alloc'? [-Werror=implicit-
> function-declaration]
>      182 |         ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
>          |                ^~~~~~~
>          |                d_alloc
> > > drivers/clocksource/timer-realtek-otto.c:182:14: warning: assignment to
> > > 'struct otto_tc_ctrl *' from 'int' makes pointer from integer without a
> > > cast [-Wint-conversion]
>      182 |         ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
>          |              ^
>    drivers/clocksource/timer-realtek-otto.c:212:9: error: implicit declaration
> of function 'kfree' [-Werror=implicit-function-declaration]
>      212 |         kfree(ctrl);
>          |         ^~~~~
>    cc1: some warnings being treated as errors
>
>
> vim +182 drivers/clocksource/timer-realtek-otto.c
>
>    176  
>    177  static int __init otto_tc_init(struct device_node *node)
>    178  {
>    179          struct otto_tc_ctrl *ctrl;
>    180          int err;
>    181  
>  > 182          ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);

I'll include linux/slab.h in v2.

Best,
Sander