From patchwork Sun Apr 23 03:24:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Ningke X-Patchwork-Id: 676474 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA144C7618E for ; Sun, 23 Apr 2023 03:25:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229580AbjDWDZq (ORCPT ); Sat, 22 Apr 2023 23:25:46 -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 X-FEAS-AUTH-USER: lnk_01@hust.edu.cn Precedence: bulk List-ID: X-Mailing-List: linux-spi@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;