Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2672724lqo; Tue, 14 May 2024 06:11:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXJZx76nMbPec4YLmO1ZdLYEoK1oi1pqQwo5C4V9leu3HzQdh1K96fqzttVyD0EqsfaAEkiqZFQpj+93oWwoPBW+rV9RBmFA3anIRhfSA== X-Google-Smtp-Source: AGHT+IFAwHlMwoHavM4h5vj9BRA8wlL7WHvY2dpWLz6izPS/m+Y52y7yplBD2Egk188BfCaz2veY X-Received: by 2002:a05:6a00:2284:b0:6ee:1d68:d33 with SMTP id d2e1a72fcca58-6f4e02ca2abmr14080214b3a.15.1715692269735; Tue, 14 May 2024 06:11:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715692269; cv=pass; d=google.com; s=arc-20160816; b=KEg2n27/vTbdIYJtJpNM4jyUblmhZRWucJWHOLk4NDxJY3FDE/d/JcNG+7/8KpEF/T xinFd7WOCD210CsmC15f/jbxkfbCqaD5fsJ2me7coTs8gAsMTK521olxy5ZkINZJRfXV R36ojDjMKwuhds82+qo8xf5FKKMs94yFNkJvIhWNkg1W7uQvNkOVJCP5YC1VlUeF9aTC rKfYnI/ydCcuU8f1pYLBK3AeXful34DTqz2TB0H8xczT4+tPA3c8iIVcz1rpESi4gsXL 2CHd99XPXF5O2wm68KgcFMApcT6V+asjV9HlGmvalDoBm73wAIHxwMssyaEpWLzxdZQj v+Ag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=U0Cb9X2qBIQBWitLs5L7vBYJiHPqJR8QWFz7O38mRZs=; fh=iQIEIpegfxGHAXzmCmQbfua7u3pb28YTuJpmY/Z0V14=; b=e2kuhZ6dzzL2js02/UHKRQLSr8qioh3kZFrweP8xZlC/ybhKZsqeoBsvPvWuPSkscP MmhO7WM2eh2T/YgCqrM5LdXg9VC9uer519nohXwAfooih67ZqWV8n3hdhLVj3OsMvzIu mo/ec5CFqXDsK+B9Z8iMx6eLvwexO5pwheTo5tlo23inkuuTKY4o0DNTwRGw1UeI3+zg MXb7bd3pCqbmOFsTWrdlzWc8TXp94aUochehd+mliljw3JIXhFWAORMvg6vDjmeGxqaB SQ48DdSXjroErrUkLef5s9f0EesxO3M8enRgMOuWZxrWM3GZnNNzyDFrccku8fCMBvRK 2IXg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-178699-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178699-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-63409e83731si11195109a12.5.2024.05.14.06.11.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 06:11:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178699-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-178699-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178699-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 31AFE284C14 for ; Tue, 14 May 2024 13:10:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AB5AA1420DF; Tue, 14 May 2024 13:09:29 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84D731411CF for ; Tue, 14 May 2024 13:09:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715692169; cv=none; b=oTPQ1eB0du+ErgsMPWlnAYZrCqcW3Z9KP81sCbXch34UMyaD5I6UB7Sm7lxbvalzKypO2RLV1/JXdreOhnubHe4Ktw3mmT0T9L4eH7ubh5ze7kQ183wiWNPNZM+Jpz2YADXZD3SEgkV2+t3v+0I2cAJ0jHUAGypId5QQscs1/zo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715692169; c=relaxed/simple; bh=65edET6jm+UN4MrjA0dVXg2bXDSEpLCbz9A1nWNT5T8=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=DJ283SngK0D0sGFrUPJX22Gj68fhgNhMBujZN/Euwk5kP1gSWbBhWEDQcIEviC2Sxv1y3UDXsfPACmQZYROidpCiliugzkegEauhvFzzz9M+9qrharqvSZO71IHX4nfoeKfyTDYb4ifTKiOUmMxRPFz9jfLDkilUKlC10/Lry2o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VdxS26w8VzvYcl for ; Tue, 14 May 2024 21:05:54 +0800 (CST) Received: from kwepemi500008.china.huawei.com (unknown [7.221.188.139]) by mail.maildlp.com (Postfix) with ESMTPS id D96761400CD for ; Tue, 14 May 2024 21:09:22 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemi500008.china.huawei.com (7.221.188.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 14 May 2024 21:09:22 +0800 From: Jinjie Ruan To: , CC: Subject: [PATCH] genirq: Clean code for handle_edge_irq() Date: Tue, 14 May 2024 21:09:15 +0800 Message-ID: <20240514130915.2613753-1-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500008.china.huawei.com (7.221.188.139) The pending set and mask_ack_irq() repeated twice, a new goto label can reduce a few lines of code, with no functional changes. Signed-off-by: Jinjie Ruan --- kernel/irq/chip.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 638cf5eee04b..4613dc9ff6b6 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c @@ -775,21 +775,15 @@ void handle_edge_irq(struct irq_desc *desc) desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); - if (!irq_may_run(desc)) { - desc->istate |= IRQS_PENDING; - mask_ack_irq(desc); - goto out_unlock; - } + if (!irq_may_run(desc)) + goto out_mask_ack; /* * If its disabled or no action available then mask it and get * out of here. */ - if (irqd_irq_disabled(&desc->irq_data) || !desc->action) { - desc->istate |= IRQS_PENDING; - mask_ack_irq(desc); - goto out_unlock; - } + if (irqd_irq_disabled(&desc->irq_data) || !desc->action) + goto out_mask_ack; kstat_incr_irqs_this_cpu(desc); @@ -818,6 +812,9 @@ void handle_edge_irq(struct irq_desc *desc) } while ((desc->istate & IRQS_PENDING) && !irqd_irq_disabled(&desc->irq_data)); +out_mask_ack: + desc->istate |= IRQS_PENDING; + mask_ack_irq(desc); out_unlock: raw_spin_unlock(&desc->lock); } -- 2.34.1