Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp872148pxb; Thu, 21 Oct 2021 11:04:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJze1K8f8uN22D9f5xIiJ4wIN/x7btXuErhclV4ioVcVgH2Z/wQFO3reHo+HpB3rqI6DSZF3 X-Received: by 2002:a17:90b:1bd2:: with SMTP id oa18mr8521464pjb.164.1634839477008; Thu, 21 Oct 2021 11:04:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634839477; cv=none; d=google.com; s=arc-20160816; b=BSqbbclOW/FeEjLf1Ok7D+T9L8+xzFsX4OBCtEvz8szSzoPROiqalO41JPPvvhrQUX cqkA/Y2iK5TZ8+tfVBhORS6H3yTM4IllJ6AkuzP1bOFESLDvXK3cjxtWNR0UIPfKdyNX ZodM4NHi2vygSEyxQwhHHthUA3uDLTOCvWyIBhUGtgskigQTfDGVE7KFK+r3WRZ3Tc9O nyf+rbAaFnjXxqxZG4OZznRm1aydNrwU7sTLDN50dGuuqOCYE7qqf5zDy0H/vt7VbmLR YA99BcGcxmUXZHq4at2Oj6yVu3p0RPiMzdTv9fsE4B/AJiowBR16R5fiY9gaSlBiVrDU 6pSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=0M29QgR6W281oqVCSUFadY2Q4NZhv79PYkddtXsUgpk=; b=B4BFTjjH9GcNXu/tzNTcqHrAn6InOlWrClElL6C0fYp8Faw/vGL55czF7AFi2HHS1o XgDA1cf1ieriL59mP6xj2y2w0hZWjSUFKQp8UJCCP0YngzcOJFXcuv0uh+r6LgfFrBaF bNnAYzPUy3lEyMEQBWHGOgVqcv74MoaKOUPXhBbZq/EeLNBqHnXwdmxQuRKnwgRTMzvq Ps3jqQsNqO2d3t+5nGLTspPY8l+MriEcK1/xVRLSdvXFnly0kqgFlq/ZeQLApmDXYIep 8ucw5fdkDt4JGfkuy8SsoQ21AfAK+3St/7SzwOjrhXFCfclrv910iTVhkRaIWzI+A8Qi hyaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ls13si11287730pjb.109.2021.10.21.11.04.22; Thu, 21 Oct 2021 11:04:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232425AbhJUSFT (ORCPT + 99 others); Thu, 21 Oct 2021 14:05:19 -0400 Received: from foss.arm.com ([217.140.110.172]:45914 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232420AbhJUSFQ (ORCPT ); Thu, 21 Oct 2021 14:05:16 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 719691477; Thu, 21 Oct 2021 11:03:00 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 918193F70D; Thu, 21 Oct 2021 11:02:57 -0700 (PDT) From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: aou@eecs.berkeley.edu, catalin.marinas@arm.com, deanbo422@gmail.com, green.hu@gmail.com, guoren@kernel.org, jonas@southpole.se, kernelfans@gmail.com, linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, mark.rutland@arm.com, maz@kernel.org, nickhu@andestech.com, palmer@dabbelt.com, paulmck@kernel.org, paul.walmsley@sifive.com, peterz@infradead.org, shorne@gmail.com, stefan.kristiansson@saunalahti.fi, tglx@linutronix.de, torvalds@linux-foundation.org, tsbogend@alpha.franken.de, vgupta@kernel.org, will@kernel.org Subject: [PATCH 04/15] irq: simplify handle_domain_{irq,nmi}() Date: Thu, 21 Oct 2021 19:02:25 +0100 Message-Id: <20211021180236.37428-5-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20211021180236.37428-1-mark.rutland@arm.com> References: <20211021180236.37428-1-mark.rutland@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There's no need for handle_domain_{irq,nmi}() to open-code the NULL check performed by handle_irq_desc(), nor the resolution of the desc performed by generic_handle_domain_irq(). Use generic_handle_domain_irq() directly, as this is functioanlly equivalent and clearer. At the same time, delete the stale comments, which are no longer helpful. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Marc Zyngier Cc: Thomas Gleixner --- kernel/irq/irqdesc.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 4e3c29bb603c..b07d0e1552bc 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -690,17 +690,11 @@ int handle_domain_irq(struct irq_domain *domain, unsigned int hwirq, struct pt_regs *regs) { struct pt_regs *old_regs = set_irq_regs(regs); - struct irq_desc *desc; - int ret = 0; + int ret; irq_enter(); - /* The irqdomain code provides boundary checks */ - desc = irq_resolve_mapping(domain, hwirq); - if (likely(desc)) - handle_irq_desc(desc); - else - ret = -EINVAL; + ret = generic_handle_domain_irq(domain, hwirq); irq_exit(); set_irq_regs(old_regs); @@ -721,24 +715,14 @@ int handle_domain_nmi(struct irq_domain *domain, unsigned int hwirq, struct pt_regs *regs) { struct pt_regs *old_regs = set_irq_regs(regs); - struct irq_desc *desc; - int ret = 0; + int ret; /* * NMI context needs to be setup earlier in order to deal with tracing. */ WARN_ON(!in_nmi()); - desc = irq_resolve_mapping(domain, hwirq); - - /* - * ack_bad_irq is not NMI-safe, just report - * an invalid interrupt. - */ - if (likely(desc)) - handle_irq_desc(desc); - else - ret = -EINVAL; + ret = generic_handle_domain_irq(domain, hwirq); set_irq_regs(old_regs); return ret; -- 2.11.0