Re: [PATCH v1 1/1] cpuidle: Update header inclusion
From: Rafael J. Wysocki
Date: Tue Nov 25 2025 - 13:05:51 EST
On Mon, Nov 24, 2025 at 9:58 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
>
> While cleaning up some headers, I got a build error on this file:
>
> drivers/cpuidle/poll_state.c:52:2: error: call to undeclared library function 'snprintf' with type 'int (char *restrict, unsigned long, const char *restrict, ...)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>
> Update header inclusions to follow IWYU (Include What You Use)
> principle.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> ---
> drivers/cpuidle/poll_state.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c
> index 9b6d90a72601..c7524e4c522a 100644
> --- a/drivers/cpuidle/poll_state.c
> +++ b/drivers/cpuidle/poll_state.c
> @@ -4,9 +4,13 @@
> */
>
> #include <linux/cpuidle.h>
> +#include <linux/export.h>
> +#include <linux/irqflags.h>
> #include <linux/sched.h>
> #include <linux/sched/clock.h>
> #include <linux/sched/idle.h>
> +#include <linux/sprintf.h>
> +#include <linux/types.h>
>
> #define POLL_IDLE_RELAX_COUNT 200
>
> --
Applied as 6.19 material, thanks!