Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1431210ybz; Fri, 1 May 2020 23:19:24 -0700 (PDT) X-Google-Smtp-Source: APiQypLjaTQDyq23r/NzghmCF2LFI3Zit9y5lXmAxFEcbfURp/kXBY2dA6PP2veUFOtEmO+1PyuR X-Received: by 2002:aa7:d504:: with SMTP id y4mr6316430edq.295.1588400364750; Fri, 01 May 2020 23:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588400364; cv=none; d=google.com; s=arc-20160816; b=L7u+CmrGQSk5irDz6G1RzgW+7yxJIR7Q4tD59+jVpfc2vFNgpAoXfSpJf/JEXZ07S3 fMp5jY1CCwUZb8NnNNMiR+QsTH5W2sqxPzpawGFImm5olSTA9pIhlSPXSeFm4cFpg1hO CKrvSAXiKXKjkBs1ajQUWNbvoXnM3rNvGf/TAeIRw8SaxwLOzsg1ReEUMbPCVS9Bx7DY B2B/XrINLDGwNsk6EAHfYEKSKfEW95ChvJuljkdAQ5qH0i0v4aCH/0sTZb7HBOkUd5wo 1oMsZHgRaILhvAWYzZ/ovyIFYTeWV2mVvGx7+4N2WQEfl3YeI7i0gRnnrRlK0ywEEk+Y 1/Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Din1w2ASyXGi9G2pWeFUI8MH44793rR/ACeXZmqu3Gg=; b=JDyQbcuPO9zYT4EmXSTQGRMaeRfnjCdYh1fAzGXpQaoeCi/aA1ksqLdyehsZZxTdbk i1qV7igaUhFLXUI0Tnp8OWcKQiuhAcg4SrzME5tIGAYZZb+hEr0+9JpjeSAYK0ElDf5L v5T5+lZIO7HZvBKGJC/B3kVljcluZYo/Tqq+Q09l+YZhGmwaCUEZEcdSt7oMJ47wp8Gp gsX7cUFiwjAfIIbE66QzRc2ZMhY2gDGgiO6f8Gg2CZWlK9EnXKVioiErTxE7daHl/owK AINRMrgXcKzWcIKcCauw36abXAngO8CDM2SLLQQvJ6A68m1+D+XoNNUCXqaAe2c8KJoZ w4LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eDu3tcE8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l9si3058000ejc.237.2020.05.01.23.19.01; Fri, 01 May 2020 23:19:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eDu3tcE8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726787AbgEBGPk (ORCPT + 99 others); Sat, 2 May 2020 02:15:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:51298 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726058AbgEBGPk (ORCPT ); Sat, 2 May 2020 02:15:40 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 76B5821775; Sat, 2 May 2020 06:15:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588400139; bh=P1G9XTk6/zTFJDfUeyPIvBiffh6K8okBFUBHJ5TkZvY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eDu3tcE8yBlXCT4EEkbq6EGPGsc+QaWK+l5JsE7CT1KqGrux/+91GpomWgneZBDGI TlaMW6qgHqlCY8eFJaFoc5Z/1nIYSkSgSfYKSV/HqWK1hrlMWyLY9KuEXslxnW4NgZ s/BaJy30d8q5L0xLnyVKnmAgWfboXCsNp7jqkUAY= Date: Sat, 2 May 2020 08:15:37 +0200 From: Greg Kroah-Hartman To: Bjorn Helgaas Cc: Thomas Gleixner , "Rafael J . Wysocki" , Aman Sharma , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: Re: [PATCH v2 1/2] driver core: platform: Clarify that IRQ 0 is invalid Message-ID: <20200502061537.GA2527384@kroah.com> References: <20200501224042.141366-1-helgaas@kernel.org> <20200501224042.141366-2-helgaas@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200501224042.141366-2-helgaas@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 01, 2020 at 05:40:41PM -0500, Bjorn Helgaas wrote: > From: Bjorn Helgaas > > These interfaces return a negative error number or an IRQ: > > platform_get_irq() > platform_get_irq_optional() > platform_get_irq_byname() > platform_get_irq_byname_optional() > > The function comments suggest checking for error like this: > > irq = platform_get_irq(...); > if (irq < 0) > return irq; > > which is what most callers (~900 of 1400) do, so it's implicit that IRQ 0 > is invalid. But some callers check for "irq <= 0", and it's not obvious > from the source that we never return an IRQ 0. > > Make this more explicit by updating the comments to say that an IRQ number > is always non-zero and adding a WARN() if we ever do return zero. If we do > return IRQ 0, it likely indicates a bug in the arch-specific parts of > platform_get_irq(). I worry about adding WARN() as there are systems that do panic_on_warn() and syzbot trips over this as well. I don't think that for this issue it would be a problem, but what really is this warning about that someone could do anything with? Other than that minor thing, this looks good to me, thanks for finally clearing this up. greg k-h