Re: [PATCH v3 1/3] Revert "kernel/reboot.c: convert simple_strtoul to kstrtoint"

From: Petr Mladek
Date: Thu Nov 05 2020 - 13:02:21 EST


On Tue 2020-11-03 22:40:23, Matteo Croce wrote:
> From: Matteo Croce <mcroce@xxxxxxxxxxxxx>
>
> This reverts commit 616feab753972b9751308f3cd2a68fc57eae8edb.
>
> kstrtoint() and simple_strtoul() have a subtle difference which makes
> them non interchangeable: if a non digit character is found amid the
> parsing, the former will return an error, while the latter will just
> stop parsing, e.g. simple_strtoul("123xyx") = 123.
>
> The kernel cmdline reboot= argument allows to specify the CPU used
> for rebooting, with the syntax `s####` among the other flags,
> e.g. "reboot=warm,s31,force", so if this flag is not the last given,
> it's silently ignored as well as the subsequent ones.
>
> Fixes: 616feab75397 ("kernel/reboot.c: convert simple_strtoul to kstrtoint")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Matteo Croce <mcroce@xxxxxxxxxxxxx>

Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>

Best Regards,
Petr