Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp855308rdh; Thu, 26 Oct 2023 19:07:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGeuGPx/lP/Umxds/dSSvaLLUCNe+UcPiitCCOjJamrQLkSszvdW8JVZtjmqMtIYmhLJ2Wu X-Received: by 2002:a81:450d:0:b0:5a7:bc38:fff2 with SMTP id s13-20020a81450d000000b005a7bc38fff2mr1381339ywa.15.1698372475452; Thu, 26 Oct 2023 19:07:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698372475; cv=none; d=google.com; s=arc-20160816; b=lSnGp070Un4tEuYhC0SaBiBQaE+MW16477TFrZKM7TYrzTHrC6vIrFjteN6XEgogdv zjnEKS76EurUfkEsho69QNCK+QGrEcsnWCttRyf+gB349bptnOsoqSg0cX0BsqsgToh0 YXdo46kKPQrr1c8Cmd9geuDFoT3kJ01/44b/rAwlPT7McC1uj6WiAOzS7QsugU5vOAxC vWWDb1H1a2oKefnxFrhF0h2DeMiS05es6djHe3CbukHXxd/5QVODLGcRhF2H2xv51LH8 y69rP9Uf1B0BPM2LM/j+oHJJLOQu4LX3ipByxptLbJaJBLLW8u6524iY0Tht3CAFc2Tl um3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=1X49FMyUPRBHHs2vHu9l7HX87qfSp39mFZBliu8In+4=; fh=UvVU2qL452vBioqq3dmKqOPysc9G3Xa2PKKzHF2c5z4=; b=MzPGmG7qWxJIdjYY7Txbuy3UouX87AyxtOufnh28dAXL7Hn3MGedNNgwnpkw7yFqTD dnfZ8L9eEm93xvyNmTZR2RDFdsScVXyjOwjK/vFPR0PGQhmL53WsF7/4KneOfig26bcc GigHAlGnG6uxFP/VoSltGiILWV6kS4yjB3UhmKxlhvOehO619J3+dSyvOTzuKIl9TYch mMZstuRC16s2ZyzepdudfHyJ/iZbZTfXK9O6RVNgzGwAd8DCM3jlICxfRJMYC7ZRJKAO odN4W8ll03W+GPvmvO/GmIatbB9dz5GJtXmemSknVL3U8f2rGrZGjlk6JO6TO75MEtSC NGFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id m19-20020a81d253000000b005a2045a893dsi972557ywl.254.2023.10.26.19.07.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 19:07:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id B67A282DEE6C; Thu, 26 Oct 2023 19:07:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345132AbjJ0CHo (ORCPT + 99 others); Thu, 26 Oct 2023 22:07:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjJ0CHm (ORCPT ); Thu, 26 Oct 2023 22:07:42 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 919B4187; Thu, 26 Oct 2023 19:07:36 -0700 (PDT) Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id D80666027ECD5; Fri, 27 Oct 2023 10:07:19 +0800 (CST) X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui To: joel@jms.id.au, andrew@codeconstruct.com.au Cc: Su Hui , robh@kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, roblip@gmail.com, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] soc: aspeed: lpc: Fix impossible judgment condition Date: Fri, 27 Oct 2023 10:07:04 +0800 Message-Id: <20231027020703.1231875-1-suhui@nfschina.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 26 Oct 2023 19:07:52 -0700 (PDT) smatch error: drivers/soc/aspeed/aspeed-lpc-snoop.c:169 aspeed_lpc_snoop_config_irq() warn: platform_get_irq() does not return zero platform_get_irq() return non-zero IRQ number or negative error code, change '!lpc_snoop->irq' to 'lpc_snoop->irq < 0' to fix this. Fixes: 9f4f9ae81d0a ("drivers/misc: add Aspeed LPC snoop driver") Signed-off-by: Su Hui --- drivers/soc/aspeed/aspeed-lpc-snoop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c b/drivers/soc/aspeed/aspeed-lpc-snoop.c index 773dbcbc03a6..8cb3a0b4692c 100644 --- a/drivers/soc/aspeed/aspeed-lpc-snoop.c +++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c @@ -166,7 +166,7 @@ static int aspeed_lpc_snoop_config_irq(struct aspeed_lpc_snoop *lpc_snoop, int rc; lpc_snoop->irq = platform_get_irq(pdev, 0); - if (!lpc_snoop->irq) + if (lpc_snoop->irq < 0) return -ENODEV; rc = devm_request_irq(dev, lpc_snoop->irq, -- 2.30.2