[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPTztWbLJ1iQ96okvTZX3JL2fkpHhOj=jPGULS2RriYg0T0eCg@mail.gmail.com>
Date: Mon, 24 Feb 2025 09:00:28 -0800
From: Frank van der Linden <fvdl@...gle.com>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Nathan Chancellor <nathan@...nel.org>,
Arnd Bergmann <arnd@...db.de>, Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
Bill Wendling <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>,
David Hildenbrand <david@...hat.com>, Zi Yan <ziy@...dia.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH 1/2] mm, cma: fix 32-bit warning
On Mon, Feb 24, 2025 at 6:11 AM Arnd Bergmann <arnd@...nel.org> wrote:
>
> From: Arnd Bergmann <arnd@...db.de>
>
> clang warns about certain always-true conditions, like this one on 32-bit
> builds:
>
> mm/cma.c:420:13: error: result of comparison of constant 4294967296 with expression of type 'phys_addr_t' (aka 'unsigned int') is always true [-Werror,-Wtautological-constant-out-of-range-compare]
> 420 | if (start < SZ_4G)
> | ~~~~~ ^ ~~~~~
>
> Replace this one with an equivalent expression that does not cause a warning.
>
> Fixes: 4765deffa0f7 ("mm, cma: support multiple contiguous ranges, if requested")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
> mm/cma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/cma.c b/mm/cma.c
> index 34a4df29af72..ef0206c0f16d 100644
> --- a/mm/cma.c
> +++ b/mm/cma.c
> @@ -417,7 +417,7 @@ int __init cma_declare_contiguous_multi(phys_addr_t total_size,
> * Create a list of ranges above 4G, largest range first.
> */
> for_each_free_mem_range(i, nid, MEMBLOCK_NONE, &start, &end, NULL) {
> - if (start < SZ_4G)
> + if (upper_32_bits(start) == 0)
> continue;
>
> start = ALIGN(start, align);
> --
> 2.39.5
>
Thanks for fixing these nits in my patch series - which, btw, needs
more reviews, if anyone's reading this - please :)
Reviewed-by: Frank van der Linden <fvdl@...gle.com>
Powered by blists - more mailing lists