Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1092855rwb; Thu, 10 Nov 2022 11:04:37 -0800 (PST) X-Google-Smtp-Source: AMsMyM55nNwEB8xPLILyaI5W0ALGVWrrw9bHOu5qeHVFrzwRyEaePtoShjadG6738NUfttgcLscf X-Received: by 2002:a50:d510:0:b0:44e:bee5:4242 with SMTP id u16-20020a50d510000000b0044ebee54242mr3054726edi.128.1668107077728; Thu, 10 Nov 2022 11:04:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668107077; cv=none; d=google.com; s=arc-20160816; b=ZIlW6d0Fg0o5gXfqltdI9pTDhs7YzBttvpGXHgT6C7vNrivlpJ7CLbkhPT0JhDdQBX JfrtmuyDB/NLdlS99ULzScHeMZdgyraHepGFB5rEFYE2Gpce1CRESJbWecsmZUz/4++0 gUi7YnTrVc+ozWUIxBKxuCVpsnpcEv9iCY3m6MxMjTdSQCsji4g+jbv5CsCN8QLIhJar T0FdS4kRhddX5Yami99mqsZh0kju9MIYWO7gJ+6Gu10xY9q8hXSMZDX5jx4bvV+CTpDj E7LizxajR6lv8jIGzfxFaL55lgi1i4gx2PY5SxsGWK/iRaZe2ObSmISmnyNUL2xUuaeK fbSA== 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=/oHQ+wt+Qt9oZ3CqhaWBF/UkSBiI+7EIi+0P3Y7V16g=; b=lQmy87asXwStgSWHsy/q7OklzDLw2d48SWaw5oJ3QMtT1GFOr9xHn4NFa63qNYe+99 eqDQBKraBUFeR+u8uSaV+jcyfiofD7RXMWwHYJZ9iIzZzsFYm5zEncnmaHprhvizOCfZ zg+PjL4GG04ic5YM8m7WB8UwcaQzYPOEIxxaQeDKXokhZw4x998+pdiyMivM1376iHRj ke1YM0ARyRCQ4iZyvsYoM6CCvDwU6mxXovMuZ7mwrFyMGHhHD+UTNlGHDxCFGQ4pyk1k YhZ6UgOte7S5neibXvrv5/CuMkqa3WLBE+2vkL2LM28HsOlfk5od5941xfX2y1tZVC4r ARoA== 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 hb7-20020a170907160700b0078d027ceb41si11625ejc.857.2022.11.10.11.04.13; Thu, 10 Nov 2022 11:04:37 -0800 (PST) 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 S229869AbiKJSjL (ORCPT + 92 others); Thu, 10 Nov 2022 13:39:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbiKJSjJ (ORCPT ); Thu, 10 Nov 2022 13:39:09 -0500 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 83C8F1CFC9 for ; Thu, 10 Nov 2022 10:39:08 -0800 (PST) Received: (qmail 10244 invoked by uid 1000); 10 Nov 2022 13:39:07 -0500 Date: Thu, 10 Nov 2022 13:39:07 -0500 From: Alan Stern To: Christophe Leroy Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH v2] usb: Check !irq instead of irq == NO_IRQ Message-ID: References: <13feefdf6b240817944e6441e26a8ddc1d81ced1.1668102802.git.christophe.leroy@csgroup.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <13feefdf6b240817944e6441e26a8ddc1d81ced1.1668102802.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, Nov 10, 2022 at 06:54:35PM +0100, Christophe Leroy wrote: > NO_IRQ is a relic from the old days. It is not used anymore in core > functions. By the way, function irq_of_parse_and_map() returns value 0 > on error. > > In some drivers, NO_IRQ is erroneously used to check the return of > irq_of_parse_and_map(). > > It is not a real bug today because the only architectures using the > drivers being fixed by this patch define NO_IRQ as 0, but there are > architectures which define NO_IRQ as -1. If one day those > architectures start using the non fixed drivers, there will be a > problem. > > Long time ago Linus advocated for not using NO_IRQ, see > https://lkml.org/lkml/2005/11/21/221 . He re-iterated the same view > recently in https://lkml.org/lkml/2022/10/12/622 > > So test !irq instead of tesing irq == 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(-) For the [eou]hci-* files: Acked-by: Alan Stern Alan Stern