summaryrefslogtreecommitdiff
path: root/rust/alloc/collections/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@linux.dev>2025-12-21 00:59:23 +0100
committerJens Axboe <axboe@kernel.dk>2025-12-28 15:54:38 -0700
commite1418af7660f67abc7f6f0cf6867f3989aa45e9a (patch)
tree0928b072d76352342cb25083ec461297b3633ecb /rust/alloc/collections/git@git.tavy.me:linux.git
parent4cef2fcda3adabcf6937170d9b869bf72a6d9dc6 (diff)
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 'rust/alloc/collections/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions