From nobody Mon Jun 8 09:51:11 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B04B23C6A56 for ; Thu, 4 Jun 2026 07:54:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780559680; cv=none; b=NyDNdO3xXWVxTIOpX7MtWQUpMA46MDPIgvUFsQRa17qTKCsRXaGTXfkjAaUIi4nhnuWw2Q4jLuUpP2rMeyCTDHg/TBUll9DueWNNDb4MhiToZeZos3Jwhj7x03OuHjeqUf88+WMjbmikt8cRtdyPhez33ZdcHSWd7bSSDHB3Ikw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780559680; c=relaxed/simple; bh=vzfJ0HkMnzphBA/Q+krZgViH67qneR/YM3XK3ioMtg8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=oQPOzFi9OWjioHCp7LSdPjSFbsozRAb/xEugnjKcKO5iYDEbiEPPs/3Sj4LesoYCQko9aE/yfqiUX3PjCQhtHzM5GLfPQ6WEV1w3jjbV82lj9bEiB1ZjCvSULDYun0DeK61FGpoSWbYm/YqwVCZVLzzoy0hyFsunFa/wA9mYPOQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E5381F00898; Thu, 4 Jun 2026 07:54:37 +0000 (UTC) From: Geert Uytterhoeven To: Greg Ungerer , Heiko Stuebner Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , kernel test robot Subject: [PATCH] m68k: hash: Use lower_16_bits() helper Date: Thu, 4 Jun 2026 09:54:23 +0200 Message-ID: X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When building for m68k with CONFIG_M68000=3Dy and C=3D1: drivers/clk/rockchip/clk-rk3528.c: note: in included file (through incl= ude/linux/hash.h, include/linux/slab.h): arch/m68k/include/asm/hash.h:57:24: warning: cast truncates bits from c= onstant value (18720 becomes 8720) arch/m68k/include/asm/hash.h:57:24: warning: cast truncates bits from c= onstant value (1e8e8 becomes e8e8) Sparse does not realize the truncation is intentional. Make this explicit by using the lower_16_bits() helper instead, which also masks the unwanted bits. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202605191434.PQkj2Rki-lkp@int= el.com/ Reported-by: Heiko Stuebner Closes: https://lore.kernel.org/20260603213726.1025094-1-heiko@sntech.de/ Signed-off-by: Geert Uytterhoeven Tested-by: Daniel Palmer --- No change in generated code. arch/m68k/include/asm/hash.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/m68k/include/asm/hash.h b/arch/m68k/include/asm/hash.h index 6d0d0c893f16dd49..6dadf493706632f5 100644 --- a/arch/m68k/include/asm/hash.h +++ b/arch/m68k/include/asm/hash.h @@ -2,6 +2,8 @@ #ifndef _ASM_HASH_H #define _ASM_HASH_H =20 +#include + /* * If CONFIG_M68000=3Dy (original mc68000/010), this file is #included * to work around the lack of a MULU.L instruction. @@ -54,7 +56,7 @@ static inline u32 __attribute_const__ __hash_32(u32 x) : "=3D&d,d" (a), "=3D&r,r" (b) : "r,roi?" (x)); /* a+b =3D x*0x8647 */ =20 - return ((u16)(x*0x61c8) << 16) + a + b; + return (lower_16_bits(x * 0x61c8) << 16) + a + b; } =20 #endif /* _ASM_HASH_H */ --=20 2.43.0