From: Yong Wu <yong.wu@mediatek.com>
To: Arnd Bergmann <arnd@kernel.org>, Joerg Roedel <joro@8bytes.org>,
"Will Deacon" <will@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Tomasz Figa <tfiga@chromium.org>,
Robin Murphy <robin.murphy@arm.com>,
<iommu@lists.linux-foundation.org>,
<linux-mediatek@lists.infradead.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <llvm@lists.linux.dev>
Subject: Re: [PATCH] iommu/mediatek: fix out-of-range warning with clang
Date: Tue, 28 Sep 2021 09:21:41 +0800 [thread overview]
Message-ID: <d7db3e4c3c4a40843d60fe92666d7f9e90df8801.camel@mediatek.com> (raw)
In-Reply-To: <20210927121857.941160-1-arnd@kernel.org>
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.
WARNING: multiple messages have this Message-ID (diff)
From: Yong Wu <yong.wu@mediatek.com>
To: Arnd Bergmann <arnd@kernel.org>, Joerg Roedel <joro@8bytes.org>,
"Will Deacon" <will@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
llvm@lists.linux.dev, Nick Desaulniers <ndesaulniers@google.com>,
linux-kernel@vger.kernel.org,
Nathan Chancellor <nathan@kernel.org>,
iommu@lists.linux-foundation.org,
linux-mediatek@lists.infradead.org,
Robin Murphy <robin.murphy@arm.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] iommu/mediatek: fix out-of-range warning with clang
Date: Tue, 28 Sep 2021 09:21:41 +0800 [thread overview]
Message-ID: <d7db3e4c3c4a40843d60fe92666d7f9e90df8801.camel@mediatek.com> (raw)
In-Reply-To: <20210927121857.941160-1-arnd@kernel.org>
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.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
WARNING: multiple messages have this Message-ID (diff)
From: Yong Wu <yong.wu@mediatek.com>
To: Arnd Bergmann <arnd@kernel.org>, Joerg Roedel <joro@8bytes.org>,
"Will Deacon" <will@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Nathan Chancellor <nathan@kernel.org>,
"Nick Desaulniers" <ndesaulniers@google.com>,
Tomasz Figa <tfiga@chromium.org>,
Robin Murphy <robin.murphy@arm.com>,
<iommu@lists.linux-foundation.org>,
<linux-mediatek@lists.infradead.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <llvm@lists.linux.dev>
Subject: Re: [PATCH] iommu/mediatek: fix out-of-range warning with clang
Date: Tue, 28 Sep 2021 09:21:41 +0800 [thread overview]
Message-ID: <d7db3e4c3c4a40843d60fe92666d7f9e90df8801.camel@mediatek.com> (raw)
In-Reply-To: <20210927121857.941160-1-arnd@kernel.org>
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
WARNING: multiple messages have this Message-ID (diff)
From: Yong Wu <yong.wu@mediatek.com>
To: Arnd Bergmann <arnd@kernel.org>, Joerg Roedel <joro@8bytes.org>,
"Will Deacon" <will@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Nathan Chancellor <nathan@kernel.org>,
"Nick Desaulniers" <ndesaulniers@google.com>,
Tomasz Figa <tfiga@chromium.org>,
Robin Murphy <robin.murphy@arm.com>,
<iommu@lists.linux-foundation.org>,
<linux-mediatek@lists.infradead.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <llvm@lists.linux.dev>
Subject: Re: [PATCH] iommu/mediatek: fix out-of-range warning with clang
Date: Tue, 28 Sep 2021 09:21:41 +0800 [thread overview]
Message-ID: <d7db3e4c3c4a40843d60fe92666d7f9e90df8801.camel@mediatek.com> (raw)
In-Reply-To: <20210927121857.941160-1-arnd@kernel.org>
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-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-09-28 1:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-27 12:18 [PATCH] iommu/mediatek: fix out-of-range warning with clang Arnd Bergmann
2021-09-27 12:18 ` Arnd Bergmann
2021-09-27 12:18 ` Arnd Bergmann
2021-09-27 12:18 ` Arnd Bergmann
2021-09-28 1:21 ` Yong Wu [this message]
2021-09-28 1:21 ` Yong Wu
2021-09-28 1:21 ` Yong Wu
2021-09-28 1:21 ` Yong Wu
2021-09-28 9:59 ` Joerg Roedel
2021-09-28 9:59 ` Joerg Roedel
2021-09-28 9:59 ` Joerg Roedel
2021-09-28 9:59 ` Joerg Roedel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d7db3e4c3c4a40843d60fe92666d7f9e90df8801.camel@mediatek.com \
--to=yong.wu@mediatek.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=matthias.bgg@gmail.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=robin.murphy@arm.com \
--cc=tfiga@chromium.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.