From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32CA1C1975A for ; Thu, 12 Mar 2020 22:45:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ED9DC206CD for ; Thu, 12 Mar 2020 22:45:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="K4JgnG5o"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="oiPs69xd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED9DC206CD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YeF3mK0j/G9VQkmuaoo70lfswZpsYxldKei6i/RGFho=; b=K4JgnG5ookNUyt sMrRqJNXP+1Jo12Ni9WnOpZQ5pBxtIr0lrgIuLStwGd9UDtnPF/NygxHwml6ENU8MHS82OmseflXM Jw/l7hxVOUCp9C4F8/S+VsNw755mWRF3N6P850dcF8/QTTh+0/bGPGhkeZy+PMYjKaE3v6rnhJxp6 rnA83DeynfteSGZI+aaqiHYpbt6P5tMpF0BAUuUSm3AJPz22oqMKf1/11ht7tePe4FRm1zLYuWBy0 FYQSbefB6OpM+SINZ4Qc/yVRSkRW9oN7wXGymxfbGWvB0fb7SQFX4qT1mIZZzD0NjhtlHHcGPuwS6 iAByG5WE3saYegPrz6Ug==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCWa9-0003m9-Pz; Thu, 12 Mar 2020 22:45:37 +0000 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCWa5-0003fW-0V for linux-arm-kernel@lists.infradead.org; Thu, 12 Mar 2020 22:45:34 +0000 Received: by mail-lj1-x243.google.com with SMTP id 19so8378092ljj.7 for ; Thu, 12 Mar 2020 15:45:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+ZeV6SGwYz2oD3/6K0sLROfW8IF3ilKt8DtskElDrSY=; b=oiPs69xdfQO1PidLik8ECa+vZDnXjhz4IA9cfdIrSFWeQSVkq3f6Vuqtg7nqOSGpzz aPWaBfMxN76W6k+YcI62A04x9LTXaoGqfRVdTioZMtxmFIZ2XX/m9C8hi/X99aUXJ914 9ZtRAdysFJjEsfngds8YFemQQIhGyWn7G4Y+IJL3vZL9RHKV9oZAdCdRXkqabn6itURW KehVOuHkxHYZ9iwT8WXYqXYA8GHnZmhc1a05rnJWy6NO2Zi4yA063X/yFhLO6pNOpfVR Nonz5KsXWFXaNuIPo/oM14mD6mg9ict9ghMTx/DvkJzdTyQWtVsc+S8eNXdCJTm1ZqhJ Kd5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+ZeV6SGwYz2oD3/6K0sLROfW8IF3ilKt8DtskElDrSY=; b=E/b2ZM8IU731KsGzxTwf7bTL7CFAK28tEMNyYd14eOtinINoQ7oihonjUAsj2dOQPD hK1LpIKKvI48ngkDPwlPNAtjjBbUQFSXtWyXWYCLcxQkqidDTIEinT5KzB5Wf1oycbzj euYSFl5grs/YxmQH+BZNTZYBPg/wXykkQv8DcoITeuR3N0bOAt41FBIorXMRY961EX4L 2Y18imE+KFazL7t/LcChZT1ppQrJnqM2bdrLIGETeFcyXay8fdShdfcxT+XHvqUNYxcI 0CmlDg8esWBvgsGiTuEA8mQQeEkJkrCsHdsUNlHUWb7NPQkiazsm2c8hw6JcRrRJYW9R bePA== X-Gm-Message-State: ANhLgQ3iTsInLtDSaLXXbOL/Joc2yHLb4Sp1DoRbaPNqPuycgiVpMCrs QlzRD5wXQ4qOo8TZXtBUhUYvlILDVpd5dAJ+ZmMDFQ== X-Google-Smtp-Source: ADFU+vtWfdH9h+8ouBw1URtkmc7DSWqDje0HNsyXDSW5sqzgoSdTiC3LGQo1g/WEOkxlBaUBFPb4j6lbqK8aPWb9ouk= X-Received: by 2002:a2e:894d:: with SMTP id b13mr5954798ljk.99.1584053130191; Thu, 12 Mar 2020 15:45:30 -0700 (PDT) MIME-Version: 1.0 References: <20200312190202.GA110276@google.com> In-Reply-To: <20200312190202.GA110276@google.com> From: Linus Walleij Date: Thu, 12 Mar 2020 23:45:21 +0100 Message-ID: Subject: Re: [PATCH 1/5] pci: handled return value of platform_get_irq correctly To: Bjorn Helgaas X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200312_154533_120779_FFFD2DA4 X-CRM114-Status: GOOD ( 10.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ryder Lee , Karthikeyan Mitran , Marc Gonzalez , linux-pci , Hou Zhiqiang , Aman Sharma , "linux-kernel@vger.kernel.org" , Lorenzo Pieralisi , "moderated list:ARM/Mediatek SoC support" , Thomas Petazzoni , Marc Zyngier , Matthias Brugger , Thomas Gleixner , Mans Rullgard , Linux ARM , Andrew Murray Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Mar 12, 2020 at 8:02 PM Bjorn Helgaas wrote: > IIUC, in the link you mentioned, Linus T says that "dev->irq == 0" > means we don't have a valid IRQ. I think that makes sense, but I'm > not sure it follows that 0 must be a sensical return value for > platform_get_irq(). It seems to me that platform_get_irq() ought to > return either a valid IRQ or an error, and the convention for errors > is a negative errno. OK I see your point. I would be fine of the code is changed from: if (irq <= 0) error; To: if (irq < 0) error retrieving IRQ if (!irq) error driver requires a valid IRQ To the driver (this one in specific) the IRQ is expected and necessary and I think it holds for most PCI hosts. Yours, Linus Walleij _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel