Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7857996rwn; Wed, 14 Sep 2022 05:40:48 -0700 (PDT) X-Google-Smtp-Source: AA6agR5HJHMxix43s4QlmrI/DKAj1DpL7/T/fITzawZQyaRC76lj9q9eoVX3os07ublHGGvl6fZ0 X-Received: by 2002:a17:907:9495:b0:734:e049:3d15 with SMTP id dm21-20020a170907949500b00734e0493d15mr26183137ejc.187.1663159248422; Wed, 14 Sep 2022 05:40:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663159248; cv=none; d=google.com; s=arc-20160816; b=hpbfmcRImWWe0tOoU5Q34Ixh17+1AHLEI0Q5y4YgQovhGABo4IjjqzVT5pu+w3ugmG F2IsuV/mMnkIsH+zktvBvLrSpiOHmRCSSIsWjDMqw7CTivkjwCJYwkpw7PLRJFgawNOa 96DskDj+2N4mzxmGCwhB91s+puYckfjOaKPmPi1YhxqpdaD0PandNp2P+j+SbyIDcTcQ TscgiTrDH/KorAvU3051oF06hxeJxixWBY3GOjQOoxfcj+3CCEtFPvsMJfXEWff/E5BW 0vU24/4QtGQVl+PuzjPUWR2f151wQnIYAM19YK1751xlUtGnl75hCS2DmyUVUWOfdAa3 IEWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=AJJJF2jlmHI0reXygD4L3yfABL+fllmHuDHZ2JL85l0=; b=kSbEc6jQ9Ny4OF3u/6rHc4rj0uGPgQVBiWKwwDOpDOadHOqdW2Nh2rFCvLXAGi7n3X EaAsAppeRF6lgK4GqVjc3YbMc0DWzvbemOt35KrZWbVcqDNkLhiYc5FIYcjdpAzBXhwJ /ueR7tTLedP/3cEpq0UtU7bAEbaxWjxMhrkvxmyRfbp7/GM9WQZ4lY2VYMUdAms5tA3A SrxCYc0PuI6CP+bGlp1HgLNZW2KWhpZRTd/MkMaE2M8LPRlWKoA+lrQmmEUxnwKbJUl2 7OXkWmUYqZ0WEBpyt3mAFAaCevwuLOTfI839LnryJr7F3PZXUsYNZiRLoomqmLEw7b1r dQcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V1UAQySe; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k20-20020a170906579400b007771bc8dbb4si10974850ejq.781.2022.09.14.05.40.22; Wed, 14 Sep 2022 05:40:48 -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=@kernel.org header.s=k20201202 header.b=V1UAQySe; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229513AbiINMCK (ORCPT + 99 others); Wed, 14 Sep 2022 08:02:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbiINMB4 (ORCPT ); Wed, 14 Sep 2022 08:01:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CA6A7EFDE for ; Wed, 14 Sep 2022 05:01:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8919B61591 for ; Wed, 14 Sep 2022 12:01:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9A6FC433C1; Wed, 14 Sep 2022 12:01:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663156912; bh=zbU7V8GZUYZoodteNkKDgmV8Jfp8ZglHXbHFoYtzxS0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=V1UAQySeXAwWk8LsfXZv8KwCxakQyIl0EVcNG1kFmhhe9E6iH5p1CYkSNJ3q+hJ8P kUNsmFvu6mItnBGpJ5hmnV5zFhE4jvBGcgOWnZWUrjm+zaRpG115lmVDIKRm7269/O sQgrDKw5/Ue1Ug2Abc7yTISoitWsx+4vDfpZWwp3cZ5s2LnDhgnjqQVEXkYF7rIlEd emXMq3AYc2dzPMO5t6VcvzsvVaKu4zLBwZcKbS/izaIbPI0H9qP1JTWscT0KJcs9TY ZPueFfgaCMug9t8xUH4naA+Z0Uy2jg/QtWco1ekYVkwx3Kep8tKoNzKybS2LnhkuCY K9qrdQEi8zdXQ== Received: from [89.101.193.66] (helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oYR5S-00ABwB-OQ; Wed, 14 Sep 2022 13:01:50 +0100 Date: Wed, 14 Sep 2022 13:01:50 +0100 Message-ID: <87wna6kvv5.wl-maz@kernel.org> From: Marc Zyngier To: Zhang Jianhua Cc: , , , , , Subject: Re: [PATCH -next] genirq: Change can_request_irq() return value type to bool In-Reply-To: <20220914110615.3570933-1-chris.zjh@huawei.com> References: <20220914110615.3570933-1-chris.zjh@huawei.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 89.101.193.66 X-SA-Exim-Rcpt-To: chris.zjh@huawei.com, tglx@linutronix.de, samuel@sholland.org, brgl@bgdev.pl, mark.rutland@arm.com, lvjianmin@loongson.cn, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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, 14 Sep 2022 12:06:15 +0100, Zhang Jianhua wrote: > > 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, irqreturn_t action_ret); > extern int noirqdebug_setup(char *str); > > /* 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); > > /* 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 = irq_get_desc_lock(irq, &flags, 0); > - int canrequest = 0; > + bool canrequest = false; > > if (!desc) > - return 0; > + return false; > > if (irq_settings_can_request(desc)) { > if (!desc->action || > irqflags & desc->action->flags & IRQF_SHARED) > - canrequest = 1; > + canrequest = true; > } > irq_put_desc_unlock(desc, flags); > return canrequest; I'm sorry, but this is a very pointless change. Not only this doesn't change anything for this particular code other than being cosmetic, but it also doesn't help any of the callers which are still using an int. In general, this sort of patch only adds noise, and I'd like to see less of them. Thanks, M. -- Without deviation from the norm, progress is not possible.