mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
firmware: exynos-acpm: Use unsigned int for acpm_pmic_linux_errmap index
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>
This commit is contained in:
committed by
Krzysztof Kozlowski
parent
6de23f81a5
commit
910e91a649
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user