Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp651385ybh; Wed, 18 Mar 2020 06:44:53 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuZBQI7KrUC7AL5Uo6e2L/nzQJcuOrURstnZ+5eK5UHhXYf8nXPuAl+d4yImkp4opwBCR67 X-Received: by 2002:a9d:5cc5:: with SMTP id r5mr3660711oti.43.1584539093113; Wed, 18 Mar 2020 06:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584539093; cv=none; d=google.com; s=arc-20160816; b=A4aQpw6583+14FT+VQRNK3x8NBbRMbN2Y1cYj3zrdYFvZC1q4H5h8omx6YZpofG1z6 AQcwAz2MHssaRCc6xOugZ8q4f3cYQQk4C9iDU9MTXaVOEmDZo0jhbpqE+VepQss81USS 9LNTy9LtJGNe8bZt9uEQZvfh0XhdaLONo+p+BtJhHxaaW0955XWtJWUTXMktFWX02kvl STNgixKZwh93b5knVJ7mV8w6/7n/bIT5PM71b1OQlCfwF5Y0YRNcstA1onHh9vuLu6Sp uR0F8blyAiGe+dhcydWpU3j7ZQdp0yS/V2wUnUo8K5aoI6ssVQRj05G3m28TogciNdfJ VxVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=naCgfdbthz0sGUziBZ+9ztGaCO4BftZXMC9due+v8rE=; b=SiEwvx1KmMCxACfEXd39VhqEXrX3jtjukFeyRoX4dMICGVil1DdY5AKlPWOn6x8Am9 kXQbvHCi27SRG4eWdGB6/fGJlsFYjeS/CTBeMcTKM6PdModA5ZG0/X+iD2tZKFDEr+57 8zfCv2iUyTYqwopi6ou9HsJyuvYBJi46a46mIuxSqq8vrsPK91Ecjl50HH59eyUKmemg sQ2txNT2wbS9gF4DGLqzb7AFiqMVV/CNfZV4zqWEBd1fqPOYqCdKXBW5nZVUfcCsZ1pI DViLJC3dVRMev0uCEvDRzZq+1kkPZgjKs0bEJzNUSAL8UmzkCuqyIKIB/xn1Fo0lsDPI bGpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11si3506800otj.170.2020.03.18.06.44.40; Wed, 18 Mar 2020 06:44:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727033AbgCRNnD (ORCPT + 99 others); Wed, 18 Mar 2020 09:43:03 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:57342 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726730AbgCRNnD (ORCPT ); Wed, 18 Mar 2020 09:43:03 -0400 Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jEYyA-00051t-4D; Wed, 18 Mar 2020 14:42:50 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 7E66A1040C5; Wed, 18 Mar 2020 14:42:48 +0100 (CET) From: Thomas Gleixner To: Bjorn Helgaas Cc: Marc Gonzalez , Aman Sharma , Lorenzo Pieralisi , Thomas Petazzoni , Andrew Murray , Linus Walleij , Ryder Lee , Karthikeyan Mitran , Hou Zhiqiang , Mans Rullgard , Matthias Brugger , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Marc Zyngier Subject: Re: [PATCH 4/5] pci: handled return value of platform_get_irq correctly In-Reply-To: <20200317220334.GA230141@google.com> References: <20200317220334.GA230141@google.com> Date: Wed, 18 Mar 2020 14:42:48 +0100 Message-ID: <874kulbwyv.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Bjorn, Bjorn Helgaas writes: > On Fri, Mar 13, 2020 at 04:56:42PM -0500, Bjorn Helgaas wrote: >> On Fri, Mar 13, 2020 at 10:05:58PM +0100, Thomas Gleixner wrote: >> > > I think the best pattern is: >> > > >> > > irq = platform_get_irq(pdev, i); >> > > if (irq < 0) >> > > return irq; >> > >> > Careful. 0 is not a valid interrupt. >> >> Should callers of platform_get_irq() check for a 0 return value? >> About 900 of them do not. I don't know what I was looking at. platform_get_irq() does the right thing already, so checking for irq < 0 is sufficient. Sorry for the confusion! Thanks, tglx