From mboxrd@z Thu Jan 1 00:00:00 1970 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 4CBC7282F15 for ; Mon, 8 Jun 2026 10:53:36 +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=1780916018; cv=none; b=nX6VXDVoMjAfku8D7frutWB9gAz0A91omUOiqygd6O04ANaunGNyp2zxzJVh9NAH/UKHaiJDUhg+BQ1RRRi3M0W/a6F5vy/gGGioR9NrY+YZv87Vo4EaD8DuZYdLGhIfeN578/Q2EQ0qVKoB8iN+nXSSWKUvWejVWeWb7Yl0yR4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780916018; c=relaxed/simple; bh=Ta1ZsCqpRUZti2Vq9Z+hPPEtIydKAG4B2o//fkeZ52g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KsWAuG1MDQR9V6DnVpeogNw7Ppg4X3zVBZS8W2Ca/2yHpEx3cuy6AoZR28p7wvpzLlaOghiL4lF3/pB7u3fY1mjLfadzqhjC9URlwXjEfPJJ3A60zmYRk/CAMzOZWhRfdJpn68KcD4tkKJUa7V8R8sg3BpfG6majY+odm46sfoc= 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 B9BB21F00893; Mon, 8 Jun 2026 10:53:35 +0000 (UTC) Message-ID: <5ef09276-0b04-4e5a-a472-c73d01ee6ac2@linux-m68k.org> Date: Mon, 8 Jun 2026 20:53:31 +1000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] m68k: hash: Use lower_16_bits() helper To: Geert Uytterhoeven , Heiko Stuebner Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org, kernel test robot References: Content-Language: en-US From: Greg Ungerer In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Geert, On 4/6/26 17:54, Geert Uytterhoeven wrote: > When building for m68k with CONFIG_M68000=y and C=1: > > drivers/clk/rockchip/clk-rk3528.c: note: in included file (through include/linux/hash.h, include/linux/slab.h): > arch/m68k/include/asm/hash.h:57:24: warning: cast truncates bits from constant value (18720 becomes 8720) > arch/m68k/include/asm/hash.h:57:24: warning: cast truncates bits from constant 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@intel.com/ > Reported-by: Heiko Stuebner > Closes: https://lore.kernel.org/20260603213726.1025094-1-heiko@sntech.de/ > Signed-off-by: Geert Uytterhoeven FWIW: Acked-by: Greg Ungerer Regards Greg > --- > 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 > > +#include > + > /* > * If CONFIG_M68000=y (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) > : "=&d,d" (a), "=&r,r" (b) > : "r,roi?" (x)); /* a+b = x*0x8647 */ > > - return ((u16)(x*0x61c8) << 16) + a + b; > + return (lower_16_bits(x * 0x61c8) << 16) + a + b; > } > > #endif /* _ASM_HASH_H */