From nobody Fri Apr 3 08:21:03 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D2AAECAAD3 for ; Wed, 14 Sep 2022 11:09:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229780AbiINLJw (ORCPT ); Wed, 14 Sep 2022 07:09:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbiINLJs (ORCPT ); Wed, 14 Sep 2022 07:09:48 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37F57248C3 for ; Wed, 14 Sep 2022 04:09:48 -0700 (PDT) Received: from canpemm500005.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MSHZ42r71zlVkh; Wed, 14 Sep 2022 19:05:48 +0800 (CST) Received: from huawei.com (10.67.174.96) by canpemm500005.china.huawei.com (7.192.104.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 14 Sep 2022 19:09:46 +0800 From: Zhang Jianhua To: , , , , , CC: , Subject: [PATCH -next] genirq: Change can_request_irq() return value type to bool Date: Wed, 14 Sep 2022 19:06:15 +0800 Message-ID: <20220914110615.3570933-1-chris.zjh@huawei.com> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.67.174.96] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500005.china.huawei.com (7.192.104.229) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The function can_request_irq() is used to judge whether the irq can be allocated, so bool type would be more suitable for it. Signed-off-by: Zhang Jianhua --- include/linux/irq.h | 2 +- kernel/irq/manage.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/irq.h b/include/linux/irq.h index c3eb89606c2b..3a60c2313fb9 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -707,7 +707,7 @@ extern void note_interrupt(struct irq_desc *desc, irqre= turn_t action_ret); extern int noirqdebug_setup(char *str); =20 /* Checks whether the interrupt can be requested by request_irq(): */ -extern int can_request_irq(unsigned int irq, unsigned long irqflags); +extern bool can_request_irq(unsigned int irq, unsigned long irqflags); =20 /* Dummy irq-chip implementations: */ extern struct irq_chip no_irq_chip; diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 40fe7806cc8c..d6940d15bf56 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -925,19 +925,19 @@ EXPORT_SYMBOL(irq_set_irq_wake); * particular irq has been exclusively allocated or is available * for driver use. */ -int can_request_irq(unsigned int irq, unsigned long irqflags) +bool can_request_irq(unsigned int irq, unsigned long irqflags) { unsigned long flags; struct irq_desc *desc =3D irq_get_desc_lock(irq, &flags, 0); - int canrequest =3D 0; + bool canrequest =3D false; =20 if (!desc) - return 0; + return false; =20 if (irq_settings_can_request(desc)) { if (!desc->action || irqflags & desc->action->flags & IRQF_SHARED) - canrequest =3D 1; + canrequest =3D true; } irq_put_desc_unlock(desc, flags); return canrequest; --=20 2.31.0