Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6365564rwr; Mon, 24 Apr 2023 19:16:00 -0700 (PDT) X-Google-Smtp-Source: AKy350aQJl10EltPdEBl21aS5CWLshszbWIMp/NS3ESYCzd9RnY5Rg7OYhExDlUMwhuCTCcKpIpi X-Received: by 2002:a17:903:234b:b0:1a6:7ed0:147e with SMTP id c11-20020a170903234b00b001a67ed0147emr21480089plh.33.1682388959777; Mon, 24 Apr 2023 19:15:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682388959; cv=none; d=google.com; s=arc-20160816; b=l95AquYDbysbKVHhJMGlPP1NFOixkEbSlnEr3l35F+3JF97n2M/CS5Y24k2Tdy2g1z P7IIZLjSLmTCyikGxFiIXCwChIZgsxTaOi9ylnoXXBRYx8NGAqy9kP/j4E6+uGKRA/k8 m1kB/s6LnFMPopTd7wo2Xg7sG7Q66X3Iw9eZ5TLyodAlSvcUh5CNbcHmAULyf3fe6ngT ilFRkAdgPKpzU+eN7Ja6pMRmzbXi8QrS3biI0gQqeFJuKQ5pDN/8PVtC6xUuMoQfq7aN oWzp7d+1Oeo/F8h1fbmbwV3UB/kJ7nJHzNG1LDaoc2xGGQ2O8nGEWlzoZ7dSMk3XvtLR VWsg== 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=nYnThadTarY2Cyua2E3ipeMN0m8+GCkLUSp9lBJxGW4=; b=t8fjDXB6dARb4h6d7ha4KoIAwKJdMut4jUfVpO5gFnylioBRc2EAlvDHAU5TxXkRRo OrW15lfJVr4x2dEZDG3s4NzR9fbJs/tq7Zs8XW/MLx0dHvVr9h6O6c773uW8TS+hiyxL TNkfW/Hh/SmJf0bxlgcULy8rbLbmYCO17c9Ui7alCM4OFKJRX62yavE5WsIHq5o0R3iI st+6iqi/x6hT8vf8iUwo0U1FZevuOoyAimqbTZi9ztmJWD38M6EJYxP/VvEQIYb7wBdn VeMK0lQkAkWRF2/WAkkmQ1tcS6wxpgSKaD0BRuOwThg/ik/mdjA2t3zgnQXjbKYtI8DE 8cqg== 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 e15-20020a17090301cf00b001a6d4ec7c89si13442212plh.222.2023.04.24.19.15.45; Mon, 24 Apr 2023 19:15:59 -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 S233025AbjDYB4J (ORCPT + 99 others); Mon, 24 Apr 2023 21:56:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231350AbjDYB4I (ORCPT ); Mon, 24 Apr 2023 21:56:08 -0400 Received: from hust.edu.cn (mail.hust.edu.cn [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EEBA19BF; Mon, 24 Apr 2023 18:56:06 -0700 (PDT) Received: from pride-poweredge-r740.. ([172.16.0.254]) (user=lihuya@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 33P1tmux021762-33P1tmv0021762 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 25 Apr 2023 09:55:48 +0800 From: Liang Yuhang To: Thinh Nguyen , Greg Kroah-Hartman Cc: hust-os-kernel-patches@googlegroups.com, Liang Yuhang , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND v2] usb: dwc3: remove dead code in dwc3_otg_get_irq Date: Tue, 25 Apr 2023 09:55:32 +0800 Message-Id: <20230425015532.13622-1-lihuya@hust.edu.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-FEAS-AUTH-USER: lihuya@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 platform_get_irq() only return non-zero irq number on success, or negative error number on failure. There is no need to check the return value of platform_get_irq() to determine the return value of dwc3_otg_get_irq(), removing them to solve this problem. Signed-off-by: Liang Yuhang --- v1 -> v2: change name to real name --- drivers/usb/dwc3/drd.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/drd.c index 039bf241769a..c2e09700212d 100644 --- a/drivers/usb/dwc3/drd.c +++ b/drivers/usb/dwc3/drd.c @@ -154,11 +154,6 @@ static int dwc3_otg_get_irq(struct dwc3 *dwc) goto out; irq = platform_get_irq(dwc3_pdev, 0); - if (irq > 0) - goto out; - - if (!irq) - irq = -EINVAL; out: return irq; -- 2.34.1