[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3b8d0145-bf01-9ec0-acb3-54081fb57d7f@samsung.com>
Date: Fri, 9 Apr 2021 13:53:32 +0200
From: Sylwester Nawrocki <s.nawrocki@...sung.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Marek Szyprowski <m.szyprowski@...sung.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Tomasz Figa <tomasz.figa@...il.com>,
Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH] pinctrl: samsung: use 'int' for register masks in
Exynos
On 08.04.2021 21:50, Krzysztof Kozlowski wrote:
> 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@...onical.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@...sung.com>
> ---
>
> Not tested on ARM64.
I have tested it on exynos5433/tm2e and didn't notice any issues
as we could expect.
The patch looks good to me, however I would personally use u32
rather than "unsigned int", like in other places for the register
value variables.
--
Regards,
Sylwester
Powered by blists - more mailing lists