[PATCH] drm/tegra: Fix shift overflow in tegra_shared_plane_atomic_update
Thierry Reding
thierry.reding at gmail.com
Thu Apr 15 15:49:14 UTC 2021
On Thu, Apr 15, 2021 at 08:29:14AM -0700, Nathan Chancellor wrote:
> Clang warns:
>
> drivers/gpu/drm/tegra/hub.c:513:11: warning: shift count >= width of
> type [-Wshift-count-overflow]
> base |= BIT(39);
> ^~~~~~~
>
> BIT is unsigned long, which is 32-bit on ARCH=arm, hence the overflow
> warning. Switch to BIT_ULL, which is 64-bit and will not overflow.
>
> Fixes: 7b6f846785f4 ("drm/tegra: Support sector layout on Tegra194")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1351
> Signed-off-by: Nathan Chancellor <nathan at kernel.org>
> ---
> drivers/gpu/drm/tegra/hub.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
This code never runs on 32-bit platforms, so another option would be to
not try and build this on 32-bit configurations either. But none of the
rest of the code is built conditionally, so fixing this is preferable.
Applied, thanks.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20210415/b3f9700b/attachment-0001.sig>
More information about the dri-devel
mailing list