Re: [PATCH v2 2/4] printk: deprecate boot_delay in favour of printk_delay

From: sashiko-bot

Date: Tue Jun 30 2026 - 12:56:19 EST


Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] Sysctl handler `proc_dointvec_minmax` is incorrectly used for an `unsigned int` variable.
- [Low] Passing an incompatible pointer type (`unsigned int *`) to `get_option()`, which expects an `int *`.
--

commit 75c913a5c205c791c2728e8990c05d9b6634f1b5
Author: Andrew Murray <amurray@xxxxxxxxxxxxxxxxxxxx>

printk: deprecate boot_delay in favour of printk_delay

This commit deprecates the boot_delay kernel parameter in favor of
printk_delay. It extends printk_delay to be configurable via an early
kernel parameter, allowing it to function during both boot and runtime.
The delay is now skipped when messages are suppressed across all system
states.

> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index 77f53eaed1321..cc203327247aa 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c

[ ... ]

> @@ -1339,11 +1327,34 @@ static void boot_delay_msec(int level)
> }
> }
> #else
> -static inline void boot_delay_msec(int level)
> +static inline void __init printk_delay_calculate(void)
> {
> }
>
> +static inline void early_boot_delay_msec(void)
> {
> }
> #endif
>
> +static int __init printk_delay_setup(char *str)
> +{
> + get_option(&str, &printk_delay_msec);

[Severity: Low]
Does this pointer sign mismatch introduce a build regression?

The get_option() function expects an int * for its second argument, but
printk_delay_msec was changed to an unsigned int in this patch. This triggers
a -Wincompatible-pointer-types warning, which is often treated as an error by
modern compilers.

[ ... ]

> @@ -2117,20 +2128,30 @@ static u8 *__printk_recursion_counter(void)
> local_irq_restore(flags); \
> } while (0)
>
> -int printk_delay_msec __read_mostly;
> +unsigned int printk_delay_msec __read_mostly;

[Severity: Low]
Is the sysctl handler for printk_delay_msec still correct?

In kernel/printk/sysctl.c, the sysctl entry for printk_delay_msec uses
the proc_dointvec_minmax handler, which expects a pointer to a signed int.
Since printk_delay_msec is now an unsigned int, should this be updated to
proc_douintvec_minmax to prevent an API regression?

--
Sashiko AI review · https://sashiko.dev/#/patchset/20260630-deprecate_boot_delay-v2-0-f9883d36aa4b@xxxxxxxxxxxxxxxxxxxx?part=2