Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3171970imw; Wed, 6 Jul 2022 19:22:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vnbz+rGYKmRCbQ6yadqki75HLpzYBZK+ORPGHwiBvD+vNMytFlqp7YYzkbCJ8xpotSvrmO X-Received: by 2002:a17:90b:4c8c:b0:1ef:9d26:3087 with SMTP id my12-20020a17090b4c8c00b001ef9d263087mr2166856pjb.195.1657160526889; Wed, 06 Jul 2022 19:22:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657160526; cv=none; d=google.com; s=arc-20160816; b=TfHpAfwZxL58yF3zh+Xzh6AODC7O9XUYnZZseyEoaFh2+6m0xuWRvZ+TDBO4NlrPdw cfeSAAwUJt50wM/0lG0y1ERydjYxYOBf7p23/a74Nvu1h8f1X+HymW7DZ9kR0V5OI3e8 q72WWRjonKtXp8VGP2GLQAhWQNUygxLzH3t0CS4bEGGmpYmiPmFVMlESKKB6YIggaLWL ut/g7bcNjH9Bji+1GKvqyYAKRfEkkcF4SZsI9MgNJVg7RGLRSfhe0zmsZaLmRYSU2OKW M66IDjQaFYaUV7wVgXLlcx+X97Yh3zVjf61ypf68sqr72tDke58Mzklbiba4KAbTReLX RweQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:feedback-id:dkim-signature; bh=Oqjo7bte1PnK+DaOS4Pw+4uzHzG8H+vyhDqlF6sLUXU=; b=jhr7GOy7l/rJ7sCoz/x93I6PDLVUCvFrc6DLN6M3IGr1qScsYpdNacDQUhdwxJcung Rd2jnl6GaB6h4B75cMdzxiWSL8nSBnsvGwpHDkR30YhVve179m/IyyeuvKxWuMQkjKJT UHNWlzmWfZwXo2SmsNrdcLSqjDcroxXxhFQ2GWwi7RlvMhnhqxR16Ygw3xfKrhxDymu2 7LkUcgOTU9j/gtXL3Q4l3TxYr+IJ4E8xObFGvLj44DJdxjjWwIvfw0/pHX4m+/E9L8vg XZewPbsOWgQQ9NuV18A2L2RyKiy0uaeKnVEHXKUFvUwdK79yHFqZ+HxjEVn243Nyyacr jQxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=jNedMEQd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h24-20020a17090adb9800b001ef7a713b62si4748541pjv.59.2022.07.06.19.21.54; Wed, 06 Jul 2022 19:22:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=jNedMEQd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234792AbiGGCLd (ORCPT + 99 others); Wed, 6 Jul 2022 22:11:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231826AbiGGCLd (ORCPT ); Wed, 6 Jul 2022 22:11:33 -0400 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 760952F013 for ; Wed, 6 Jul 2022 19:11:31 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 3760C320014C; Wed, 6 Jul 2022 22:11:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 06 Jul 2022 22:11:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1657159887; x=1657246287; bh=Oqjo7bte1PnK+DaOS4Pw+4uzHzG8 H+vyhDqlF6sLUXU=; b=jNedMEQdn3OAOPkBqKQgVB50yYJJlF49ciekBr04fdy4 4T+sJoQCUFY5dEj8/8go2nuWOHibfv3jiM2IdGDDskvR+g3jd32+J8i/iiDipJ8h LLtIIM0bsmLg9RCmKMMqkMbFs3LCisOMztECRR5H4gCPSgR0wJ6w/D5a6Sx007Kw xBpM5PEteepeGfN2z8XdRp9mfA8t7yL9DLU1Pw9C1ZXrV43tWFg4phBLwtjrlg1Y Wdg5HaqzIRtCNAVcCLBS6Og1QiWseyWES4QqW3Yi2dma8uGti0PTaE3LN7ZoObOZ rSSvXxSS9mBLcuhXAlhkM0BjQU9WqRCuod6RQOIGiQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeigedgheejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevufgjkfhfgggtsehttdertddttddvnecuhfhrohhmpefhihhnnhcu vfhhrghinhcuoehfthhhrghinheslhhinhhugidqmheikehkrdhorhhgqeenucggtffrrg htthgvrhhnpeelueehleehkefgueevtdevteejkefhffekfeffffdtgfejveekgeefvdeu heeuleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hfthhhrghinheslhhinhhugidqmheikehkrdhorhhg X-ME-Proxy: Feedback-ID: i58a146ae:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Jul 2022 22:11:24 -0400 (EDT) Date: Thu, 7 Jul 2022 12:11:33 +1000 (AEST) From: Finn Thain To: Geert Uytterhoeven cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] m68k: mac: Remove forward declaration for mac_nmi_handler() In-Reply-To: Message-ID: <181e93f-9830-75db-a088-6cbff0de27da@linux-m68k.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 Jul 2022, Geert Uytterhoeven wrote: > Move mac_nmi_handler() before its caller, so its forward declaration can > be dropped. While at it, make the function static, and absorb the > variable in_nmi, which is only used inside the function. > > Signed-off-by: Geert Uytterhoeven Reviewed-by: Finn Thain BTW, this code needs the race condition fixed but I think that would require CONFIG_ADVANCED && CONFIG_RMW_INSNS, and arch/m68k/Kconfig.cpu advises against it. There is some discussion of Amiga and Atari in relation to RMW and it's claimed "it is also said to destabilize other machines" which may be true but doesn't help much. > --- > To be queued in the m68k tree for v5.20. > > arch/m68k/mac/macints.c | 32 +++++++++++++++----------------- > 1 file changed, 15 insertions(+), 17 deletions(-) > > diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c > index e3575388cd05a8cc..883e48230f87a187 100644 > --- a/arch/m68k/mac/macints.c > +++ b/arch/m68k/mac/macints.c > @@ -129,8 +129,6 @@ > > extern void show_registers(struct pt_regs *); > > -irqreturn_t mac_nmi_handler(int, void *); > - > static unsigned int mac_irq_startup(struct irq_data *); > static void mac_irq_shutdown(struct irq_data *); > > @@ -142,6 +140,21 @@ static struct irq_chip mac_irq_chip = { > .irq_shutdown = mac_irq_shutdown, > }; > > +static irqreturn_t mac_nmi_handler(int irq, void *dev_id) > +{ > + static volatile int in_nmi; > + > + if (in_nmi) > + return IRQ_HANDLED; > + in_nmi = 1; > + > + pr_info("Non-Maskable Interrupt\n"); > + show_registers(get_irq_regs()); > + > + in_nmi = 0; > + return IRQ_HANDLED; > +} > + > void __init mac_init_IRQ(void) > { > m68k_setup_irq_controller(&mac_irq_chip, handle_simple_irq, IRQ_USER, > @@ -254,18 +267,3 @@ static void mac_irq_shutdown(struct irq_data *data) > else > mac_irq_disable(data); > } > - > -static volatile int in_nmi; > - > -irqreturn_t mac_nmi_handler(int irq, void *dev_id) > -{ > - if (in_nmi) > - return IRQ_HANDLED; > - in_nmi = 1; > - > - pr_info("Non-Maskable Interrupt\n"); > - show_registers(get_irq_regs()); > - > - in_nmi = 0; > - return IRQ_HANDLED; > -} >