* [PATCH] init: Replace simple_strtoul() with kstrtouint() in root_delay_setup()
@ 2025-11-03 8:06 Kaushlendra Kumar
2025-11-03 12:06 ` Jan Kara
2025-11-05 11:49 ` Christian Brauner
0 siblings, 2 replies; 3+ messages in thread
From: Kaushlendra Kumar @ 2025-11-03 8:06 UTC (permalink / raw)
To: viro, brauner, jack; +Cc: linux-fsdevel, Kaushlendra Kumar
Replace deprecated simple_strtoul() with kstrtouint() for better error
handling and input validation. Return 0 on parsing failure to indicate
invalid parameter, maintaining existing behavior for valid inputs.
The simple_strtoul() function is deprecated in favor of kstrtoint()
family functions which provide better error handling and are recommended
for new code and replacements.
Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
---
init/do_mounts.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 3c5fd993bc7e..3284226f7a2a 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -120,7 +120,8 @@ static int __init fs_names_setup(char *str)
static unsigned int __initdata root_delay;
static int __init root_delay_setup(char *str)
{
- root_delay = simple_strtoul(str, NULL, 0);
+ if (kstrtouint(str, 0, &root_delay))
+ return 0;
return 1;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] init: Replace simple_strtoul() with kstrtouint() in root_delay_setup()
2025-11-03 8:06 [PATCH] init: Replace simple_strtoul() with kstrtouint() in root_delay_setup() Kaushlendra Kumar
@ 2025-11-03 12:06 ` Jan Kara
2025-11-05 11:49 ` Christian Brauner
1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2025-11-03 12:06 UTC (permalink / raw)
To: Kaushlendra Kumar; +Cc: viro, brauner, jack, linux-fsdevel
On Mon 03-11-25 13:36:27, Kaushlendra Kumar wrote:
> Replace deprecated simple_strtoul() with kstrtouint() for better error
> handling and input validation. Return 0 on parsing failure to indicate
> invalid parameter, maintaining existing behavior for valid inputs.
>
> The simple_strtoul() function is deprecated in favor of kstrtoint()
> family functions which provide better error handling and are recommended
> for new code and replacements.
>
> Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> init/do_mounts.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/init/do_mounts.c b/init/do_mounts.c
> index 3c5fd993bc7e..3284226f7a2a 100644
> --- a/init/do_mounts.c
> +++ b/init/do_mounts.c
> @@ -120,7 +120,8 @@ static int __init fs_names_setup(char *str)
> static unsigned int __initdata root_delay;
> static int __init root_delay_setup(char *str)
> {
> - root_delay = simple_strtoul(str, NULL, 0);
> + if (kstrtouint(str, 0, &root_delay))
> + return 0;
> return 1;
> }
>
> --
> 2.34.1
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] init: Replace simple_strtoul() with kstrtouint() in root_delay_setup()
2025-11-03 8:06 [PATCH] init: Replace simple_strtoul() with kstrtouint() in root_delay_setup() Kaushlendra Kumar
2025-11-03 12:06 ` Jan Kara
@ 2025-11-05 11:49 ` Christian Brauner
1 sibling, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2025-11-05 11:49 UTC (permalink / raw)
To: Kaushlendra Kumar; +Cc: Christian Brauner, linux-fsdevel, viro, jack
On Mon, 03 Nov 2025 13:36:27 +0530, Kaushlendra Kumar wrote:
> Replace deprecated simple_strtoul() with kstrtouint() for better error
> handling and input validation. Return 0 on parsing failure to indicate
> invalid parameter, maintaining existing behavior for valid inputs.
>
> The simple_strtoul() function is deprecated in favor of kstrtoint()
> family functions which provide better error handling and are recommended
> for new code and replacements.
>
> [...]
Applied to the vfs-6.19.misc branch of the vfs/vfs.git tree.
Patches in the vfs-6.19.misc branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-6.19.misc
[1/1] init: Replace simple_strtoul() with kstrtouint() in root_delay_setup()
https://git.kernel.org/vfs/vfs/c/a6446829f841
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-05 11:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-03 8:06 [PATCH] init: Replace simple_strtoul() with kstrtouint() in root_delay_setup() Kaushlendra Kumar
2025-11-03 12:06 ` Jan Kara
2025-11-05 11:49 ` Christian Brauner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox