Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp999538rwb; Thu, 6 Oct 2022 07:17:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Xd0PJeyTXnUDmJD5AzVs9bMwrz8OLutg7d2h91nfzfvMAL3tBpwRGcn1nSeclUE3T00/J X-Received: by 2002:a17:902:cf08:b0:17d:46b6:25f9 with SMTP id i8-20020a170902cf0800b0017d46b625f9mr4971121plg.67.1665065830913; Thu, 06 Oct 2022 07:17:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665065830; cv=none; d=google.com; s=arc-20160816; b=EFr9lrBAwDJCqEiAG9MglB2R9MwZkabPS3Uehmer7fYxv+UQId94O2TANIxVMdSdAD iC9TseFfwZVry1QBF9EOsvMSNNGsxUYog47+/VX3pn+YxWe2HkPB8EkxY2pI94N+fU1N Ug9sYMch+jKKd5ieNBuIsWf6PSQt2p8v425TKg9Duac00FpzbRWTy06QyGENIEMhszWG 38gVkpySpjEy9O+eFLVr4CVGPjD8PVx7RR7HLsq8wYC5C+aEcJpKbzFCw5+SMqXV6+xd O97WfGivpOY2xjDjDkW+6Vr8OnIWZP7v566SNGwwhCnpUHvjyL+KRARTce2wWL53tqtx 8KLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=M7EnJVMMwaMeexeT8n0jVMZsKvgKmJLrV0KJVB855s0=; b=SWDCXMB5uTd/2IkLSaTFEYsn9+HKuT/bu+JdFhDpEdzwqnK1oQuAaD4VX8B/bqg11W DzFpKyOUKRuwuAKRziT9HzQcp1xBJSkf4Acsa91DdYvwBdm4IhasjsJvQ0jyJBPYkKoy 5Usrn6KHtDMyec3VdArMfJj3eo/+kRH5QsPOkpwAHYUz5T9SiCa+SH/Z4dXzyPJuPYc2 K6uGfYfA7g2+pZZetF6sYKtRBERvNrWR0JiYJJ6OZL8Oqxd3pKxmyxP72ggDtfYZNP5j XXYldwdrmrU1O/jw8I4/RRlEZgES+9mbDFHsQ4CmXizrGJCmu5CAUOmoihjcSvOLJWRH t3cg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a6-20020a17090abe0600b0020ac8f7e87csi5023111pjs.177.2022.10.06.07.16.53; Thu, 06 Oct 2022 07:17:10 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231718AbiJFNvN (ORCPT + 99 others); Thu, 6 Oct 2022 09:51:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231796AbiJFNuw (ORCPT ); Thu, 6 Oct 2022 09:50:52 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 9127B56B95 for ; Thu, 6 Oct 2022 06:50:35 -0700 (PDT) Received: (qmail 785245 invoked by uid 1000); 6 Oct 2022 09:50:27 -0400 Date: Thu, 6 Oct 2022 09:50:27 -0400 From: Alan Stern To: Christophe Leroy Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH] usb: Replace NO_IRQ by 0 Message-ID: References: <63f6d2e7ea17f6522f36abd6cf5e6a7f25f215c6.1665033267.git.christophe.leroy@csgroup.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <63f6d2e7ea17f6522f36abd6cf5e6a7f25f215c6.1665033267.git.christophe.leroy@csgroup.eu> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS autolearn=no 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 Thu, Oct 06, 2022 at 07:15:44AM +0200, Christophe Leroy wrote: > NO_IRQ is used to check the return of irq_of_parse_and_map(). > > On some architecture NO_IRQ is 0, on other architectures it is -1. > > irq_of_parse_and_map() returns 0 on error, independent of NO_IRQ. This isn't clear. Does absence of an irq count as an error? In other words, will irq_of_parse_and_map() sometimes return 0 and other times return NO_IRQ? What about architectures on which 0 is a valid irq number? > So use 0 instead of using NO_IRQ. > > Signed-off-by: Christophe Leroy > --- > drivers/usb/host/ehci-grlib.c | 2 +- > drivers/usb/host/ehci-ppc-of.c | 2 +- > drivers/usb/host/fhci-hcd.c | 2 +- > drivers/usb/host/ohci-ppc-of.c | 2 +- > drivers/usb/host/uhci-grlib.c | 2 +- > 5 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/usb/host/ehci-grlib.c b/drivers/usb/host/ehci-grlib.c > index a2c3b4ec8a8b..0717f2ccf49d 100644 > --- a/drivers/usb/host/ehci-grlib.c > +++ b/drivers/usb/host/ehci-grlib.c > @@ -99,7 +99,7 @@ static int ehci_hcd_grlib_probe(struct platform_device *op) > hcd->rsrc_len = resource_size(&res); > > irq = irq_of_parse_and_map(dn, 0); > - if (irq == NO_IRQ) { > + if (!irq) { > dev_err(&op->dev, "%s: irq_of_parse_and_map failed\n", > __FILE__); > rv = -EBUSY; Since NO_IRQ is sometimes set to -1, shouldn't this test (and all the other ones you changed) really be doing: if (!irq || irq == NO_IRQ) { ... ? Alan Stern