From patchwork Wed Sep 13 14:08:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 138815 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp1113734vqx; Wed, 13 Sep 2023 07:10:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFdQTAbJqeIbkwa8d08qLA2jMMdFLVJSLExHR0hku8LbmOErjsqQMjcpo4abKCAjMcFiQOM X-Received: by 2002:a17:903:2289:b0:1b8:a67f:1c15 with SMTP id b9-20020a170903228900b001b8a67f1c15mr8774053plh.25.1694614246664; Wed, 13 Sep 2023 07:10:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694614246; cv=none; d=google.com; s=arc-20160816; b=mxlqfv21V6xssLLQhHQ7JQxMBBzW0gvYf4oUaW0sJsFETnpyAYm/f5aqffK9vbnebf 7SIwUazDP2vbqcTGEGUROge9jrEeeaZ4FcFGmz2xLLPDu4E54ENsAjxTHFKm4TJQEnNL KkAHqSeigJQVqegiABr/dnfTx5ysN5DnQycsO/Vd+a+4QucILPzoMyLqVareodGfQSHx uucmvwMwkcOvxOhEC1VdgZZ5XUg5okbjrMF1BUegS+goeQoKsjbG3P2zPhvSOpEQDHJs f00QXi5YTfQ6RLzXQSZbJddE/Eg/+P3AqUnGXT6NZP7j9UxLcF89WrbKL796pdPzZqHY uQHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=1DVdACuFLAXqgZ8SHbHZsCIitSBnFXnO0EyqKzGpLbI=; fh=fKMC3BTGjlLXl5EvEhzqt3WHCynqYJKK7wAqLAOkWUw=; b=Pql+QnUwjQpIcBCNW8B9ePrCZ9AwsZgik1tanJbK7sqnsNFpn9LVxKYHI6V3c+/bzt hoHX7dQGlPIGw5TgaTyA1zb3AP/Uiqb5+H43lrVu4KcU2wd/Y0oCm/3a05KGoHKlXGlz WUy7Iw7luRNlmtZyRd5A0JM6zO4hERP6iysh1gwJQD7Ey76exYNksTN8seJsXg8L14Lm do6dQrZFeSzlMIQJGfBdk4SheXJHcXo6i1I93exFTNhIGLKfs1/tFX81fTmR5+SCKFB6 wx3Ua1JaGHM+2roNxzt9mcPMyDuGO3FSr8aIXIt9H7Ck9wtwuLIqVF6d2TqIg55Dzt2p rRAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id d5-20020a170903230500b001c35864fdbbsi10786078plh.406.2023.09.13.07.10.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 07:10:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id E003380BB1EA; Wed, 13 Sep 2023 07:10:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241515AbjIMOKI (ORCPT + 36 others); Wed, 13 Sep 2023 10:10:08 -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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 13 Sep 2023 07:10:42 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776931828099167752 X-GMAIL-MSGID: 1776931828099167752 When building with W=1: arch/m68k/apollo/config.c: In function ‘dn_timer_int’: arch/m68k/apollo/config.c:171:32: warning: variable ‘x’ 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) irqreturn_t dn_timer_int(int irq, void *dev_id) { - volatile unsigned char x; + unsigned char *at = (unsigned char *)apollo_timer; legacy_timer_tick(1); timer_heartbeat(); - x = *(volatile unsigned char *)(apollo_timer + 3); - x = *(volatile unsigned char *)(apollo_timer + 5); + READ_ONCE(*(at + 3)); + READ_ONCE(*(at + 5)); return IRQ_HANDLED; }