lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250224141120.1240534-1-arnd@kernel.org>
Date: Mon, 24 Feb 2025 15:07:35 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>,
	Nathan Chancellor <nathan@...nel.org>,
	Frank van der Linden <fvdl@...gle.com>
Cc: 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: [PATCH 1/2] mm, cma: fix 32-bit warning

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ