]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
firmware: exynos-acpm: Use unsigned int for acpm_pmic_linux_errmap index
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Thu, 19 Feb 2026 11:27:10 +0000 (12:27 +0100)
committerKrzysztof Kozlowski <krzk@kernel.org>
Tue, 24 Feb 2026 11:06:29 +0000 (12:06 +0100)
acpm_pmic_to_linux_err() uses an unsigned integer obtained from messages
as index of array to map them to error codes.  Array index cannot be
negative, so make that explicit.

Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260219-firmare-acpm-counted-v2-1-e1f7389237d3@oss.qualcomm.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
drivers/firmware/samsung/exynos-acpm-pmic.c

index 961d7599e4224ef6ebe64dfa2fcb441a4dbd78a3..44265db34ae64f91205548c19f48bbfd5b8501c7 100644 (file)
@@ -41,7 +41,7 @@ static const int acpm_pmic_linux_errmap[] = {
        [2] = -EACCES, /* Write register can't be accessed or issues to access it. */
 };
 
-static int acpm_pmic_to_linux_err(int err)
+static int acpm_pmic_to_linux_err(unsigned int err)
 {
        if (err >= 0 && err < ARRAY_SIZE(acpm_pmic_linux_errmap))
                return acpm_pmic_linux_errmap[err];