Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp643709rwl; Thu, 23 Mar 2023 23:13:50 -0700 (PDT) X-Google-Smtp-Source: AKy350YHLkb+UjWPFX5akDbB40cDD+r1y6wa6RFGGDZ+CFaqwztyERbBZOASRAyGvMC1U2nELaw8 X-Received: by 2002:a17:90a:be0c:b0:23f:5a76:506 with SMTP id a12-20020a17090abe0c00b0023f5a760506mr1475304pjs.46.1679638429780; Thu, 23 Mar 2023 23:13:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679638429; cv=none; d=google.com; s=arc-20160816; b=OHbs3SOjj903E/Wt0H5A6dr9WK2/408XEK9TqSRWGT1HRdWNOZxAvIIdH6IBc0vKdM rGGK2MH1MJ2BaqcZyQmG7GxBSKWtWmiIQSToZk0ZdkiLBcqlsd7/xBG6B+XEQKaFoZ8p xWLczJ0ADOYG2KW4x6b/2iHvxEeVBbBFZXnNqgKd91Wr8ANncw4SA9XgKN4bqrMg0AVV z8Rx6P72TiDSsj9T7BlYqPrrJzt5Tv/x6tL7ZTtfPDgPyKFzNP3VyYeQxcswIPGqf1l2 qd3Xv3vHpS7qRYEso7jF6SxbtxMvfy5jIAZuRalerImS6VKrK+rGGLwPWzmRvk3XGVwY i4Jw== 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=lBU7/TIIWuoEXuYMmOWsDufUyzjulAruTFHKRxbaTH4=; b=s4wPM9Bt0MFhG+nKFTO8wGSYZuMDxDQz5YaoYdvceMwAd08ipiM6sYTQ46zUVpZQZu 2CzhYfN+EoP4HBWHSLMYi29mkfUg3dbievgBEgpFEkLjDgyAN4QzP6N0TSYBxNlZBLNR CCKXZJtxiJqzbjyhGpckuX6v3LIMtaSWt3GHcHFzsKiFyjqsXCi0eIg9jjjX41MlyAOa s2BrRybCitL+YE5Scs+19Lr5+eMBrGYQSHq1rpoesyX5+P0U+nGRUuiEgSKYtuC5zO2M 5vaCe3FqVXfozL8J5L0fbmXpn9lFA0u5RrvavBvgwCtZxQuXMmp1a/xILf4mKqBGAx78 Liow== 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 lp2-20020a17090b4a8200b00230c06399e8si3771614pjb.89.2023.03.23.23.13.37; Thu, 23 Mar 2023 23:13:49 -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 S231652AbjCXGLN (ORCPT + 99 others); Fri, 24 Mar 2023 02:11:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231357AbjCXGLL (ORCPT ); Fri, 24 Mar 2023 02:11:11 -0400 Received: from hust.edu.cn (mail.hust.edu.cn [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8534028D0F; Thu, 23 Mar 2023 23:11:08 -0700 (PDT) Received: from localhost.localdomain ([172.16.0.254]) (user=mx_xiang@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 32O69qcD019681-32O69qcE019681 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 24 Mar 2023 14:10:05 +0800 From: Mingxuan Xiang To: Thinh Nguyen , Greg Kroah-Hartman Cc: hust-os-kernel-patches@googlegroups.com, Dongliang Mu , Mingxuan Xiang , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] usb: dwc3: host: remove dead code in dwc3_host_get_irq() Date: Fri, 24 Mar 2023 14:09:34 +0800 Message-Id: <20230324060934.1686859-1-mx_xiang@hust.edu.cn> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-FEAS-AUTH-USER: mx_xiang@hust.edu.cn X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 According to the description of platform_get_irq() * Return: non-zero IRQ number on success, negative error number on failure. and the code, platform_get_irq() will return -EINVAL instead of IRQ0. So platform_get_irq() no longer returns 0, there is no need to check whether the return value is 0. Found by Smatch: drivers/usb/dwc3/host.c:60 dwc3_host_get_irq() warn: platform_get_irq() does not return zero Signed-off-by: Mingxuan Xiang --- v2->v3: remove curly braces v1->v2: remove redundant goto Only compile tested. --- drivers/usb/dwc3/host.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index f6f13e7f1ba1..61f57fe5bb78 100644 --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c @@ -52,13 +52,8 @@ static int dwc3_host_get_irq(struct dwc3 *dwc) goto out; irq = platform_get_irq(dwc3_pdev, 0); - if (irq > 0) { + if (irq > 0) dwc3_host_fill_xhci_irq_res(dwc, irq, NULL); - goto out; - } - - if (!irq) - irq = -EINVAL; out: return irq; -- 2.39.2