]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mmc: core: Convert simple_stroul to kstroul
authorRiyan Dhiman <riyandhiman14@gmail.com>
Sun, 1 Sep 2024 18:22:44 +0000 (23:52 +0530)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 3 Sep 2024 12:31:32 +0000 (14:31 +0200)
commit6f25e5deca7739a27462ef26fb5c07cfb926c4e4
tree68356a3716fa2c2bd46cdd78584fc62fd4b1426a
parentd2253bfa830e907eddad13d9de99d7b6df8585a1
mmc: core: Convert simple_stroul to kstroul

simple_strtoul() is obsolete and lacks proper error handling, making it
unsafe for converting strings to unsigned long values. Replace it with
kstrtoul(), which provides robust error checking and better safety.

This change improves the reliability of the string-to-integer conversion
and aligns with current kernel coding standards. Error handling is added
to catch conversion failures, returning -EINVAL when input is invalid.

Issue reported by checkpatch:
- WARNING: simple_strtoul is obsolete, use kstrtoul instead

Signed-off-by: Riyan Dhiman <riyandhiman14@gmail.com>
Link: https://lore.kernel.org/r/20240901182244.45543-1-riyandhiman14@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/block.c