pinctrl: samsung: use 'int' for register masks in Exynos
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Thu, 8 Apr 2021 19:50:29 +0000 (21:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:12:55 +0000 (10:12 +0200)
commit28c2a1d650885a6855c495262c6957723bbfac17
tree941fd55a5b4f42e85cc8d52ee3c250b17140269e
parent2eac474900d352ee8d4bdcd4f32fbec06b4dfc61
pinctrl: samsung: use 'int' for register masks in Exynos

[ Upstream commit fa0c10a5f3a49130dd11281aa27e7e1c8654abc7 ]

The Special Function Registers on all Exynos SoC, including ARM64, are
32-bit wide, so entire driver uses matching functions like readl() or
writel().  On 64-bit ARM using unsigned long for register masks:
1. makes little sense as immediately after bitwise operation it will be
   cast to 32-bit value when calling writel(),
2. is actually error-prone because it might promote other operands to
   64-bit.

Addresses-Coverity: Unintentional integer overflow
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Link: https://lore.kernel.org/r/20210408195029.69974-1-krzysztof.kozlowski@canonical.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/samsung/pinctrl-exynos.c