From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA6EAC433F5 for ; Tue, 9 Nov 2021 22:42:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D3DFC60F4B for ; Tue, 9 Nov 2021 22:42:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345859AbhKIWpF (ORCPT ); Tue, 9 Nov 2021 17:45:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:35942 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345639AbhKIWnJ (ORCPT ); Tue, 9 Nov 2021 17:43:09 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9EC2761B2D; Tue, 9 Nov 2021 22:24:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636496656; bh=v9/eDXWs2/UBFFOvxlOTEXawMTPdS96w+dxTBRQFPiQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OniEbsS/e1czLk1db9vnP0sWYuAa5aVDYBDhIofanFeQAQXDCWZRvOveDnZZtTDBc xcbkRcdIK9lhtMiZx+WxzjqA8ArKyup5Vuh1CrsihMu+qmQ2Ro1hkG0Eh0hUq1FbEa 0f7ifzv66fc6tz4+fXGb15bt6Af9gb/R3LCKcXyKkHVeEubjeWN7Nh18SHfEjOywJT +jNxFa/Jp8dy+4sNTPSFHwvAtn5S05Mf1Cdbjf5Ud8xdBgJX0N0rxJyzGJd3xqtWiL Z5/aoy7/qRt8dA9kUqCIQoa21C/pk9AWzHV49ZjxcmdzUTh3aM+c5sYvlI2CI3hBuJ OAWU1vFcOTeDw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Bart Van Assche , linux-mips@vger.kernel.org, Thomas Bogendoerfer , Sasha Levin , Ralf@vger.kernel.org, linux-mips@linux-mips.org Subject: [PATCH AUTOSEL 4.9 08/13] MIPS: sni: Fix the build Date: Tue, 9 Nov 2021 17:23:59 -0500 Message-Id: <20211109222405.1236040-8-sashal@kernel.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211109222405.1236040-1-sashal@kernel.org> References: <20211109222405.1236040-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org From: Bart Van Assche [ Upstream commit c91cf42f61dc77b289784ea7b15a8531defa41c0 ] This patch fixes the following gcc 10 build error: arch/mips/sni/time.c: In function ‘a20r_set_periodic’: arch/mips/sni/time.c:15:26: error: unsigned conversion from ‘int’ to ‘u8’ {aka ‘volatile unsigned char’} changes value from ‘576’ to ‘64’ [-Werror=overflow] 15 | #define SNI_COUNTER0_DIV ((SNI_CLOCK_TICK_RATE / SNI_COUNTER2_DIV) / HZ) | ^ arch/mips/sni/time.c:21:45: note: in expansion of macro ‘SNI_COUNTER0_DIV’ 21 | *(volatile u8 *)(A20R_PT_CLOCK_BASE + 0) = SNI_COUNTER0_DIV; | ^~~~~~~~~~~~~~~~ Cc: linux-mips@vger.kernel.org Signed-off-by: Bart Van Assche Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/sni/time.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/sni/time.c b/arch/mips/sni/time.c index 7ee14f41fc25d..1ea060f08ffea 100644 --- a/arch/mips/sni/time.c +++ b/arch/mips/sni/time.c @@ -17,14 +17,14 @@ static int a20r_set_periodic(struct clock_event_device *evt) { *(volatile u8 *)(A20R_PT_CLOCK_BASE + 12) = 0x34; wmb(); - *(volatile u8 *)(A20R_PT_CLOCK_BASE + 0) = SNI_COUNTER0_DIV; + *(volatile u8 *)(A20R_PT_CLOCK_BASE + 0) = SNI_COUNTER0_DIV & 0xff; wmb(); *(volatile u8 *)(A20R_PT_CLOCK_BASE + 0) = SNI_COUNTER0_DIV >> 8; wmb(); *(volatile u8 *)(A20R_PT_CLOCK_BASE + 12) = 0xb4; wmb(); - *(volatile u8 *)(A20R_PT_CLOCK_BASE + 8) = SNI_COUNTER2_DIV; + *(volatile u8 *)(A20R_PT_CLOCK_BASE + 8) = SNI_COUNTER2_DIV & 0xff; wmb(); *(volatile u8 *)(A20R_PT_CLOCK_BASE + 8) = SNI_COUNTER2_DIV >> 8; wmb(); -- 2.33.0