]> git.ipfire.org Git - thirdparty/linux.git/commit
mtd: mtdoops: replace simple_strtoul with kstrtouint
authorHaoyu Lu <hechushiguitu666@gmail.com>
Fri, 10 Apr 2026 13:37:34 +0000 (21:37 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 27 Apr 2026 13:12:58 +0000 (15:12 +0200)
commit6b07cdff176bc5f8fef459b85a7e2ea09e68543f
treedf515b996dbc1324a337d7294e713d55cfa95a00
parent01f9557233e3c04be5c6705864d390682f5d7236
mtd: mtdoops: replace simple_strtoul with kstrtouint

Replace deprecated simple_strtoul with kstrtouint for better error
handling and type safety. The kstrtouint function provides stricter
validation, automatically rejecting inputs like "123abc" that
simple_strtoul would partially accept.

Using kstrtouint avoids unsigned long to int conversion and is more
appropriate for MTD device indices which are non-negative integers.

Signed-off-by: Haoyu Lu <hechushiguitu666@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/mtdoops.c