Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4091274rwr; Sat, 22 Apr 2023 20:37:41 -0700 (PDT) X-Google-Smtp-Source: AKy350ZX6iIJd/AuwFrxPGYjtHkFe2l2Z6hCROU7PmHoj4u+j/7V23MKik9cw6DFR7QWD/r9mpD/ X-Received: by 2002:a17:90a:354:b0:23d:1bef:8594 with SMTP id 20-20020a17090a035400b0023d1bef8594mr9142975pjf.1.1682221061583; Sat, 22 Apr 2023 20:37:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682221061; cv=none; d=google.com; s=arc-20160816; b=IgX/ZbzOQm1SDdrUPgIo3EZlwyQnwfOlNZ2/cFF0ydIXCpwo/6zGLEiwmP9AGv3vIS 3CbrJ8MMIjrjRMgozSbDFG1QRuaPV538Cyq5kUDKMjYU6OXk39dFb+LU8zIukNJ6bjSZ /6ECUARKI9TodT5J8r9ksh0O57/k1FgsZ8gwQHmUKsV9yPx2hQ0uq7vVfUoRqiVRqu8y uT4mEpV2VmUEfiMHMYPBAxzpyY/C1iIWwzBPNI7+1d+k/+7TyZz5T3+rUeAkzCt+StJp S1vY7e+NuXPj3NJ0VM9zudWw4EljkopJSMt4KA04IHnj0QpeASGuXe1Rj/LvXiSfol01 T6aA== 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=8Y/CLw3T9uZye7Nq7IsWDRMZq4DQZDok0pOiMrdGqbs=; b=O4KBtjZOCm3s0wa8hgISmjmeQiwOnvyvSAGTPFxYtyGuSIh18ECOmOTuFm0UYffCli 1Sxq04c5QYAB0PzBmM0a/Cl1OP++lISpLFSCHPcsgBEmyTGTRse8AqyV4iaIe7Qo4YI6 B034M2pH9/KUzPyUrE9srgIn7XdPFJxLn99ajwVdB0y95V0aRnr3KO+DQ+GMoSbXHrXR h06jQy+P5A6l+gTnUIr8xiESuzz7t2G0ZlDc8WsxCPabgdreK1umPkrij0IbaMciaIvP Wxg8ASuN1S5h7ebPI1MaWcIcgcQPlvnWAv0EJ8ZwmkhjlOeNqZ8/mWA22ud61l5NPXPh m9FA== 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 lk16-20020a17090308d000b001a216572122si8415362plb.285.2023.04.22.20.37.28; Sat, 22 Apr 2023 20:37:41 -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 S229797AbjDWDZr (ORCPT + 99 others); Sat, 22 Apr 2023 23:25:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229560AbjDWDZp (ORCPT ); Sat, 22 Apr 2023 23:25:45 -0400 Received: from hust.edu.cn (mail.hust.edu.cn [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECFBF1986; Sat, 22 Apr 2023 20:25:43 -0700 (PDT) Received: from lnk.. ([10.12.190.56]) (user=lnk_01@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 33N3On8T017117-33N3On8U017117 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 23 Apr 2023 11:24:57 +0800 From: Li Ningke To: Mark Brown Cc: hust-os-kernel-patches@googlegroups.com, Li Ningke , Dongliang Mu , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] spi: davinci: Remove dead code in `davinci_spi_probe()` Date: Sun, 23 Apr 2023 03:24:46 +0000 Message-Id: <20230423032446.34347-1-lnk_01@hust.edu.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-FEAS-AUTH-USER: lnk_01@hust.edu.cn X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,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 Smatch complains that drivers/spi/spi-davinci.c:915 davinci_spi_probe() warn: platform_get_irq() does not return zero There is no need to check whether the return value is zero as `platform_get_irq()` only returns non-zero IRQ number on success or negative error number on failure, removing them to solve this problem. Signed-off-by: Li Ningke Reviewed-by: Dongliang Mu --- The issue is found by static analysis and the patch remains untested. --- drivers/spi/spi-davinci.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index d112c2cac042..fdb241e3a7bf 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c @@ -912,8 +912,6 @@ static int davinci_spi_probe(struct platform_device *pdev) init_completion(&dspi->done); ret = platform_get_irq(pdev, 0); - if (ret == 0) - ret = -EINVAL; if (ret < 0) goto free_master; dspi->irq = ret; -- 2.34.1