summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@linux.dev>2025-12-21 02:59:23 +0300
committerJens Axboe <axboe@kernel.dk>2025-12-29 01:54:38 +0300
commite1418af7660f67abc7f6f0cf6867f3989aa45e9a (patch)
tree0928b072d76352342cb25083ec461297b3633ecb /include
parent4cef2fcda3adabcf6937170d9b869bf72a6d9dc6 (diff)
downloadlinux-e1418af7660f67abc7f6f0cf6867f3989aa45e9a.tar.xz
brd: replace simple_strtol with kstrtoul in ramdisk_size
Replace simple_strtol() with the recommended kstrtoul() for parsing the 'ramdisk_size=' boot parameter. Unlike simple_strtol(), which returns a long, kstrtoul() converts the string directly to an unsigned long and avoids implicit casting. Check the return value of kstrtoul() and reject invalid values. This adds error handling while preserving behavior for existing values, and removes use of the deprecated simple_strtol() helper. The current code silently sets 'rd_size = 0' if parsing fails, instead of leaving the default value (CONFIG_BLK_DEV_RAM_SIZE) unchanged. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions