From patchwork Thu Mar 9 15:08:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yalong Zou X-Patchwork-Id: 661559 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 9A82FC64EC4 for ; Thu, 9 Mar 2023 15:12:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230488AbjCIPMv (ORCPT ); Thu, 9 Mar 2023 10:12:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230416AbjCIPMT (ORCPT ); Thu, 9 Mar 2023 10:12:19 -0500 Received: from hust.edu.cn (mail.hust.edu.cn [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 243FE3C7BC; Thu, 9 Mar 2023 07:09:05 -0800 (PST) Received: from localhost.localdomain ([172.16.0.254]) (user=yalongz@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 329F8HZF004348-329F8HZG004348 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 9 Mar 2023 23:08:22 +0800 From: Yalong Zou To: Thinh Nguyen , Greg Kroah-Hartman Cc: Yalong Zou , Dongliang Mu , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: remove dead code in dwc3_gadget_get_irq Date: Thu, 9 Mar 2023 23:08:15 +0800 Message-Id: <20230309150815.1884260-1-yalongz@hust.edu.cn> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-FEAS-AUTH-USER: yalongz@hust.edu.cn Precedence: bulk List-ID: X-Mailing-List: linux-usb@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_gadget_get_irq(), removing them to solve this problem. Signed-off-by: Yalong Zou Signed-off-by: Dongliang Mu --- drivers/usb/dwc3/gadget.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 3c63fa97a680..6318dd2855cc 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -4409,11 +4409,6 @@ static int dwc3_gadget_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;