From patchwork Thu Nov 17 01:53:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: guo.ziliang@zte.com.cn X-Patchwork-Id: 21380 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp168297wrr; Wed, 16 Nov 2022 18:05:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf4RRbyuCjmxctOKaWLjnLCZl4N/FfJMiklrkFEadZJpvLFSk9d5gsD/oN2o3YFNUB8Hxn1I X-Received: by 2002:a63:5343:0:b0:452:8774:d5ab with SMTP id t3-20020a635343000000b004528774d5abmr173283pgl.74.1668650721093; Wed, 16 Nov 2022 18:05:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668650721; cv=none; d=google.com; s=arc-20160816; b=eiuVh4yfjynbL1Uq3D+0fTVysjVjmbNP2C0MfCVALm1mNMTEMXZWuO61y1xva+W1Pn /Rvr4mKCKCBdrMF65jOrsIeqI6Z13tZElfIHmP8wYVf00iR0xwCqqikX/YpuRmdIPC/k Setljgl8mZwidpZVMFoV+keBAW3iDn6gZEK/MGPNc6BgE8JxhVe4kDtQhmpCvTr70I7h PzLan5nXklpHqDokdnneBhzHdZzgMf+716LHEr+16Q+O26JssoejJyad6T3tXBeWvyaP fBHmlb9mZyESq+YnitpOHezDZ1OP4Q0j7YbKCf3EcU35SdMiUsZtOCvCVH53b2Baq+sF Ut8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=spzG/vFNACJfLvvQte7H6TjRPMlu2QkRYai1HccWuLk=; b=UpbLbB0Pu8xrznU51b8PgMeWd5w3bZ88sMEu9aEq7s+WLZI/7ffIHXiv5g5VDol5BG +KiecWR5w77yfeurs9pMLMZoEC1buCAniridLJhptAz1j6Ib63SjZ+N2HbWKjNTs+4zJ dSXCdoeKG4q/lSGwdLiKCE6grmc5ZF+RR46o8fFtqw2wEV1GkuIaLHG2N39ykK1YgT+0 Lsd8elsIzqDVDIQ4DQLqZzJr1MAyj+MM0dRtIJ15u89eIrKG7jlhSvUVwIP8bElCZpzt t8C0HkOYvyFtW/e0yO9zPNk8tsYJQ8aLDna3XbZMmwDTsLiOZ8fKYFfhsX5My9qakpCL FJ3A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v14-20020a056a00148e00b005726f0e2c7fsi6978856pfu.168.2022.11.16.18.05.06; Wed, 16 Nov 2022 18:05:21 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234495AbiKQBxm (ORCPT + 99 others); Wed, 16 Nov 2022 20:53:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232097AbiKQBxk (ORCPT ); Wed, 16 Nov 2022 20:53:40 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40162D7D; Wed, 16 Nov 2022 17:53:38 -0800 (PST) Received: from mxct.zte.com.cn (unknown [192.168.251.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4NCNHP0HlQz4xVnR; Thu, 17 Nov 2022 09:53:37 +0800 (CST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4NCNHM2811z501Qn; Thu, 17 Nov 2022 09:53:35 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2AH1rUJd095330; Thu, 17 Nov 2022 09:53:30 +0800 (+08) (envelope-from guo.ziliang@zte.com.cn) Received: from mapi (xaxapp03[null]) by mapi (Zmail) with MAPI id mid32; Thu, 17 Nov 2022 09:53:31 +0800 (CST) Date: Thu, 17 Nov 2022 09:53:31 +0800 (CST) X-Zmail-TransId: 2afb6375941bffffffffe743b8a8 X-Mailer: Zmail v1.0 Message-ID: <202211170953310238773@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , Subject: =?utf-8?q?=5BPATCH_linux-next=5D_usb=3A_dwc3=3A_gadget=3A_remove_re?= =?utf-8?q?dundant_ret_variable_in_dwc3=5Fgadget=5Fvbus=5Fdraw?= X-MAIL: mse-fl2.zte.com.cn 2AH1rUJd095330 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 63759421.000 by FangMail milter! X-FangMail-Envelope: 1668650017/4NCNHP0HlQz4xVnR/63759421.000/192.168.251.13/[192.168.251.13]/mxct.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63759421.000/4NCNHP0HlQz4xVnR X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749707098698291502?= X-GMAIL-MSGID: =?utf-8?q?1749707098698291502?= From: guo ziliang Return value from dwc3_gadget_vbus_draw() directly instead of taking this in another redundant variable. Signed-off-by: guo ziliang --- drivers/usb/dwc3/gadget.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- 1.8.3.1 diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index faf37c6..d984d68 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2904,7 +2904,6 @@ static int dwc3_gadget_vbus_draw(struct usb_gadget *g, unsigned int mA) { struct dwc3 *dwc = gadget_to_dwc(g); union power_supply_propval val = {0}; - int ret; if (dwc->usb2_phy) return usb_phy_set_power(dwc->usb2_phy, mA); @@ -2913,9 +2912,7 @@ static int dwc3_gadget_vbus_draw(struct usb_gadget *g, unsigned int mA) return -EOPNOTSUPP; val.intval = 1000 * mA; - ret = power_supply_set_property(dwc->usb_psy, POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, &val); - - return ret; + return power_supply_set_property(dwc->usb_psy, POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, &val); } /**