From nobody Thu Dec 18 03:56:29 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE89AEDEC5A for ; Wed, 13 Sep 2023 14:10:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241525AbjIMOKK (ORCPT ); Wed, 13 Sep 2023 10:10:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241349AbjIMOJO (ORCPT ); Wed, 13 Sep 2023 10:09:14 -0400 Received: from gauss.telenet-ops.be (gauss.telenet-ops.be [IPv6:2a02:1800:120:4::f00:11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 924721FD3 for ; Wed, 13 Sep 2023 07:08:53 -0700 (PDT) Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by gauss.telenet-ops.be (Postfix) with ESMTPS id 4Rm2PH2nZhz4x9kh for ; Wed, 13 Sep 2023 16:08:51 +0200 (CEST) Received: from ramsan.of.borg ([84.195.187.55]) by baptiste.telenet-ops.be with bizsmtp id lS8q2A0011C8whw01S8qrq; Wed, 13 Sep 2023 16:08:51 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qgQXd-003csY-TD; Wed, 13 Sep 2023 16:08:47 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qgQXv-00FV5M-78; Wed, 13 Sep 2023 16:08:47 +0200 From: Geert Uytterhoeven To: linux-m68k@lists.linux-m68k.org Cc: Arnd Bergmann , Finn Thain , Michael Schmitz , Philip Blundell , Greg Ungerer , Joshua Thompson , Sam Creasey , Laurent Vivier , linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2 25/52] m68k: apollo: Replace set but not used variable by READ_ONCE() Date: Wed, 13 Sep 2023 16:08:15 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When building with W=3D1: arch/m68k/apollo/config.c: In function =E2=80=98dn_timer_int=E2=80=99: arch/m68k/apollo/config.c:171:32: warning: variable =E2=80=98x=E2=80=99= set but not used [-Wunused-but-set-variable] 149 | volatile unsigned char x; | ^ Fix this by using READ_ONCE(), and removing the variable. As READ_ONCE() casts to volatile internally, remove the existing cast. Deduplicate the remaining casts by introducing an intermediary. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann --- v2: - Add Acked-by, - Remove volatile and dedup casts, as suggested by Finn. --- arch/m68k/apollo/config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c index 0e6801eecbaf6361..7afefb0191504d4e 100644 --- a/arch/m68k/apollo/config.c +++ b/arch/m68k/apollo/config.c @@ -146,13 +146,13 @@ void __init config_apollo(void) =20 irqreturn_t dn_timer_int(int irq, void *dev_id) { - volatile unsigned char x; + unsigned char *at =3D (unsigned char *)apollo_timer; =20 legacy_timer_tick(1); timer_heartbeat(); =20 - x =3D *(volatile unsigned char *)(apollo_timer + 3); - x =3D *(volatile unsigned char *)(apollo_timer + 5); + READ_ONCE(*(at + 3)); + READ_ONCE(*(at + 5)); =20 return IRQ_HANDLED; } --=20 2.34.1