From patchwork Tue Dec 12 14:52:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 177396 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp7774096vqy; Tue, 12 Dec 2023 06:52:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHyyKNp+p+6Q22HTp4vnN0JxwkoskwnmRCEL/5FsccMGKIHrb/hXfDsWbyGCqQeSINZaqt1 X-Received: by 2002:a17:902:6546:b0:1d0:891f:986d with SMTP id d6-20020a170902654600b001d0891f986dmr6164869pln.3.1702392773703; Tue, 12 Dec 2023 06:52:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702392773; cv=none; d=google.com; s=arc-20160816; b=x3tI79dSNsGHdrAIn06wBDhNLpJlwpBEXMURMRoJtxrpyhHxmWsFSnyMfcjO07Ga82 SDs6M9jAYnC0nvwv/53O4XgJbMgojkBw3YPuZe8rU2wTZhHZ2b0uLSrwCAXHXP1KdZwX rlGXzRvWuvfJt3scr6y8gSYyNC3vlmtOruZr+svV/XYCkO4r8f/96tYlIPTqvuIZGFFU 5To6EjixzUkU+i1Kq/Topx+ltoSiD+suVys01e5X3i2GBIovhPND4B7dWX15pv18sTEa mtKNGRDjCaS3synPIx5CStQ2/WJePdM1NzSfJbwJrE9b+TGpdq0LuKHXRrdl22ZN63/5 8x2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=4z8tpZKqZ4UtXMm//5sO6ZKH1IbaOHgpQQp7lY2ai5U=; fh=GjOtmv8kZVUL/5A3iOUdTI8Yq9ZugE3tqOnjqopEkn4=; b=Wjc8xPxUIxvZrSENpK4GH5yZAD30ScqSvc4QSvDuwWNCE6aOLmATNoR0/1Ra1kCUBw IMFGyTc8pv1kEc2BarYiuDc0AX3tADgKacin8RmtDXKn7jFKwx9M9RTugH0S1IkqSsxi YqqLdi5fbH4mP1d2vowIVtbL9GFp9LXwKwaj6qjI/q/xyD9eNcDQj1dZfzXAzAJTzUA2 Fk9oNCUlBJDABd/7Q07KvqMNiU8WrRebF+bDPlbAeAIghnruUsHDdG+CSbdEzpqEnOKG DJ8WtIzsD8Be/PEeUYtLgFSE8Jh3x9mVwM2D8qA0Oa4854UtNTOx24oR8OagQjsZN9pl JDkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3zfsLQsc; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Vd+sjz6P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id q14-20020a170902eb8e00b001cfb4caefa8si7901863plg.644.2023.12.12.06.52.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 06:52:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3zfsLQsc; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Vd+sjz6P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id AD7AC80B3B4D; Tue, 12 Dec 2023 06:52:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376947AbjLLOwg (ORCPT + 99 others); Tue, 12 Dec 2023 09:52:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376901AbjLLOwf (ORCPT ); Tue, 12 Dec 2023 09:52:35 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A8FCD5; Tue, 12 Dec 2023 06:52:41 -0800 (PST) Date: Tue, 12 Dec 2023 14:52:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1702392760; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4z8tpZKqZ4UtXMm//5sO6ZKH1IbaOHgpQQp7lY2ai5U=; b=3zfsLQscP/6RK9Dr7FHmjpSo+JO0zkF+VZVtR/iToB6gwWwGTko7C6o4yctrhDyUstTmNt i4/5s9aNQtp8HHW2BAoauk3T6aZKsa6gJVCtc4w+BVzYDNQkIrVJt+FL+yfL69QHvLJJ/8 PmFQEf6UA7o7u5BfMN2J0UYiiyLSORhVQFSsS6ZLCcyZn011MZ3VaAbEfEMKw6Owgq3vZ9 UP8lrYcDke70mSH6gVC36KO2AQ+gcfcCMM2w1FFpX3mXzuiqQ0eRSby/BK92lNpXPRPrVG 6UT3S4ARoaRDV+tyqFInoYCP0QWi071/z0hmh5j9s2iEMoG435qtkhZAVEN0KQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1702392760; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4z8tpZKqZ4UtXMm//5sO6ZKH1IbaOHgpQQp7lY2ai5U=; b=Vd+sjz6PcIbYtijpY7NH47GvJWvwifNCec8CA7txEFDPVhky3UxDo63BtQyLSoWYb4mbmx nW6hsz5PtOSE/LDQ== From: "tip-bot2 for Max Filippov" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] irqchip/irq-xtensa-pic: Clean up Cc: Max Filippov , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20231208163857.82644-1-jcmvbkbc@gmail.com> References: <20231208163857.82644-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 Message-ID: <170239275928.398.14591907265015447414.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 pete.vger.email 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 (pete.vger.email [0.0.0.0]); Tue, 12 Dec 2023 06:52:49 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785088205389427289 X-GMAIL-MSGID: 1785088205389427289 The following commit has been merged into the irq/core branch of tip: Commit-ID: 69ffab9b9e698248cbb4042e47f82afb00dc1bb4 Gitweb: https://git.kernel.org/tip/69ffab9b9e698248cbb4042e47f82afb00dc1bb4 Author: Max Filippov AuthorDate: Fri, 08 Dec 2023 08:38:57 -08:00 Committer: Thomas Gleixner CommitterDate: Tue, 12 Dec 2023 15:45:39 +01:00 irqchip/irq-xtensa-pic: Clean up - get rid of the cached_irq_mask variable - use BIT() macro instead of bit shifts - drop .disable and .enable as they are equivalent to the default implementations Signed-off-by: Max Filippov Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20231208163857.82644-1-jcmvbkbc@gmail.com --- drivers/irqchip/irq-xtensa-pic.c | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/drivers/irqchip/irq-xtensa-pic.c b/drivers/irqchip/irq-xtensa-pic.c index 0c18d1f..f9d6fce 100644 --- a/drivers/irqchip/irq-xtensa-pic.c +++ b/drivers/irqchip/irq-xtensa-pic.c @@ -12,6 +12,7 @@ * Kevin Chea */ +#include #include #include #include @@ -19,8 +20,6 @@ #include #include -unsigned int cached_irq_mask; - /* * Device Tree IRQ specifier translation function which works with one or * two cell bindings. First cell value maps directly to the hwirq number. @@ -44,34 +43,30 @@ static const struct irq_domain_ops xtensa_irq_domain_ops = { static void xtensa_irq_mask(struct irq_data *d) { - cached_irq_mask &= ~(1 << d->hwirq); - xtensa_set_sr(cached_irq_mask, intenable); -} + u32 irq_mask; -static void xtensa_irq_unmask(struct irq_data *d) -{ - cached_irq_mask |= 1 << d->hwirq; - xtensa_set_sr(cached_irq_mask, intenable); + irq_mask = xtensa_get_sr(intenable); + irq_mask &= ~BIT(d->hwirq); + xtensa_set_sr(irq_mask, intenable); } -static void xtensa_irq_enable(struct irq_data *d) +static void xtensa_irq_unmask(struct irq_data *d) { - xtensa_irq_unmask(d); -} + u32 irq_mask; -static void xtensa_irq_disable(struct irq_data *d) -{ - xtensa_irq_mask(d); + irq_mask = xtensa_get_sr(intenable); + irq_mask |= BIT(d->hwirq); + xtensa_set_sr(irq_mask, intenable); } static void xtensa_irq_ack(struct irq_data *d) { - xtensa_set_sr(1 << d->hwirq, intclear); + xtensa_set_sr(BIT(d->hwirq), intclear); } static int xtensa_irq_retrigger(struct irq_data *d) { - unsigned int mask = 1u << d->hwirq; + unsigned int mask = BIT(d->hwirq); if (WARN_ON(mask & ~XCHAL_INTTYPE_MASK_SOFTWARE)) return 0; @@ -81,8 +76,6 @@ static int xtensa_irq_retrigger(struct irq_data *d) static struct irq_chip xtensa_irq_chip = { .name = "xtensa", - .irq_enable = xtensa_irq_enable, - .irq_disable = xtensa_irq_disable, .irq_mask = xtensa_irq_mask, .irq_unmask = xtensa_irq_unmask, .irq_ack = xtensa_irq_ack,