Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1446502rwn; Thu, 8 Sep 2022 20:54:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR50kbIzcydWXi1EbXhp6k0gcMF+152pAVgUQPHUhKigmTITHe4Q4A/I+Na+2A2po+RMkOJB X-Received: by 2002:ac2:5cc7:0:b0:497:a835:48c9 with SMTP id f7-20020ac25cc7000000b00497a83548c9mr3180586lfq.62.1662695697832; Thu, 08 Sep 2022 20:54:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662695697; cv=none; d=google.com; s=arc-20160816; b=Ov83YBMGj4z55MEKJWQNT/6X7wXGshjqLE+ZIi12x0GpMwuO7b3Fr0vaCp5I/UbswY MLT5KGH5Z3hkNVdxHonVrnLrWWXHk2rqcazMhfzGSzfl83rQl6wjJ0DLA4xQSdQV+Uuy YPWze9pWcUb6A4GNKIGZ1UiIDnRB2TvANyv+yr4azqrkB0aqikuUzGan95kf/fMNAYWJ EnNOSNQsuMBaGPODexEP0XjVZK+wr/nvZCi/0ahN157wHmODloqu2sBzXPNPT1bz6DQa hqXApCDE9x+DJipILmbx589+dxqskn7ZTP40R+wMSxcNxgUtOEttdQbmGIdFSxPIYtDt QPbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=3zNw9j9Oj3a8xZV7R96iHjBv4Q8HE2dmQu56DzVnBpM=; b=D4qLPUrrO2B36KoNAoIWRR58+NjyHrUUQ4uXgfFw0vBVKybd4qLp5n0ABQ1zKYTtH4 jZpU0t4yf59biz20i148xg79SLZfqCWiDz5HfzV1NteGo1sI4BcykRo83sAZcmhEfDn2 YpdoNyRNQr2RHFKJvUH+kUPFSvee9oTcQi2niN343sYFKJMWk8uSzgs+ayB4PNiTL/uN 9Z1dpgYwmR06TPig+U1wq5HbN8whHgRFoQN/nIuB/HlFeA9hYSQ7boTTgqYZ7qaTWFGO ml4csSu4G+saYT5JItFYrI3fVwG19ddOCnEVEXfFR4hPAy70a7cyRG+0cYcZ/FprNSZz 12vg== 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 r8-20020ac25f88000000b004947c4c8fc7si298997lfe.80.2022.09.08.20.54.28; Thu, 08 Sep 2022 20:54:57 -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 S229719AbiIID3F (ORCPT + 99 others); Thu, 8 Sep 2022 23:29:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229640AbiIID3D (ORCPT ); Thu, 8 Sep 2022 23:29:03 -0400 Received: from mail.nfschina.com (mail.nfschina.com [124.16.136.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E569411EA45; Thu, 8 Sep 2022 20:29:00 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 1EC861E80D78; Fri, 9 Sep 2022 11:27:20 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FVM48eWZGjJP; Fri, 9 Sep 2022 11:27:17 +0800 (CST) Received: from localhost.localdomain (unknown [180.167.10.98]) (Authenticated sender: yuzhe@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 0B9671E80D75; Fri, 9 Sep 2022 11:27:17 +0800 (CST) From: Yu Zhe To: daniel@zonque.org, haojian.zhuang@gmail.com, robert.jarzmik@free.fr, linux@armlinux.org.uk Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, liqiong@nfschina.com, Yu Zhe Subject: [PATCH] ARM: pxa: fix platform_get_irq error checking Date: Fri, 9 Sep 2022 11:27:58 +0800 Message-Id: <20220909032758.29388-1-yuzhe@nfschina.com> X-Mailer: git-send-email 2.11.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 The platform_get_irq() function returns negative error codes on error, so change the '<=0' check to '<0' to make code more explicit. Signed-off-by: Yu Zhe --- arch/arm/mach-pxa/pxa_cplds_irqs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-pxa/pxa_cplds_irqs.c b/arch/arm/mach-pxa/pxa_cplds_irqs.c index eda5a47d7fbb..aa284031071d 100644 --- a/arch/arm/mach-pxa/pxa_cplds_irqs.c +++ b/arch/arm/mach-pxa/pxa_cplds_irqs.c @@ -115,7 +115,7 @@ static int cplds_probe(struct platform_device *pdev) return -ENOMEM; fpga->irq = platform_get_irq(pdev, 0); - if (fpga->irq <= 0) + if (fpga->irq < 0) return fpga->irq; base_irq = platform_get_irq(pdev, 1); -- 2.11.0