Thread (3 messages) 3 messages, 3 authors, 2021-09-28

Re: [PATCH] iommu/mediatek: fix out-of-range warning with clang

From: Yong Wu <yong.wu@mediatek.com>
Date: 2021-09-28 01:21:57
Also in: linux-arm-kernel, linux-iommu, lkml, llvm

On Mon, 2021-09-27 at 14:18 +0200, Arnd Bergmann wrote:
From: Arnd Bergmann <arnd@arndb.de>

clang-14 notices that a comparison is never true when
CONFIG_PHYS_ADDR_T_64BIT is disabled:

drivers/iommu/mtk_iommu.c:553:34: error: result of comparison of
constant 5368709120 with expression of type 'phys_addr_t' (aka
'unsigned int') is always false [-Werror,-Wtautological-constant-out-
of-range-compare]
        if (dom->data->enable_4GB && pa >=
MTK_IOMMU_4GB_MODE_REMAP_BASE)
                                     ~~
^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Add an explicit check for the type of the variable to skip the check
and the warning in that case.

Fixes: b4dad40e4f35 ("iommu/mediatek: Adjust the PA for the 4GB
Mode")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Yong Wu <yong.wu@mediatek.com>

Thanks.
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help