From patchwork Mon Sep 12 10:28:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: CGEL X-Patchwork-Id: 12973545 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 0E7AAECAAD5 for ; Mon, 12 Sep 2022 10:29:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230327AbiILK34 (ORCPT ); Mon, 12 Sep 2022 06:29:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230316AbiILK3j (ORCPT ); Mon, 12 Sep 2022 06:29:39 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 494FB3B955; Mon, 12 Sep 2022 03:29:15 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id c2so8152293plo.3; Mon, 12 Sep 2022 03:29:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=oUSmh1gw//zaj+S0sn3ELb0An6DYoYmCrSomQNeQSuo=; b=EA1d6WDfsA/I0rOwkkwVViigvWKWbfIoo5lV9xdow/gQFG7q5gIhfauVCgqcfLxGPK mFogrEI3GNpF1uhg+EgVRpi/kDQ5jnaEFQpqx+AgeD69pAsPPO0TtW5iyJIN2sayqdT5 eS+wjU9w7jnI7SCslNOsKtsDP+anHwoJRGCOp82BonPXbXpVpcTuLqu4+Hhsifyv1bIW LOjaweGFwVn4VvublGXbfAuauibdvB33aRV8eXMzD8NPtf7NrDj95ML9Fz1+xRyXUXUF aQWIaJHMTfqroG93ZqtKm38ovuTHD7195i/10tIlqvMa/rf/hrNRGveUTNl3MKixrAyw xADg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=oUSmh1gw//zaj+S0sn3ELb0An6DYoYmCrSomQNeQSuo=; b=naU6S3e5583S/wdERr8Oi+drwOeiauqOAxeUp5BaGjmc9kk2IpUiDmHtQu3NIgSEHg w5bSSgV58WAMo1j+LLKE+0K2wm7/pOmuo2WRVWgj//I7En+p9DphOozPQh2XjhNaPQ9X LAaxjZBUXzgEjmBzYLcP63gGQ3lNnT6cHL8B4t5S0/vN0jTrIoiUYztLuFhBk12Wg1mk v5q+wIikHt1FJtwzsHM3XkKc/eEOxdknRUKOWGNHZ5n459iL6V+vNtMaCy1iAcresTfe La5xowam44dWygGSjT+fWoqFUFjYP0JZQsJ57G2wsM+5wTRr0zMlnnGvoP/Ct2YnknRp Pb9w== X-Gm-Message-State: ACgBeo0dwydRPBLOkBQqXGC9/9oPGO8UqMZewv164RANB5XtjR+xOmPg sBG6QU6nbUgWWClgAs1NfYI= X-Google-Smtp-Source: AA6agR6V4RLuMPnEjiL2znn+YMQ6Vt1ZTsSN5ljSQfnyiLsiInyzIy5k4oKF51jCVKJ5b+RWN5/U6w== X-Received: by 2002:a17:902:b194:b0:176:d229:83bd with SMTP id s20-20020a170902b19400b00176d22983bdmr25286876plr.174.1662978554451; Mon, 12 Sep 2022 03:29:14 -0700 (PDT) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id a2-20020aa79702000000b00537aa0fbb57sm5060850pfg.51.2022.09.12.03.29.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 03:29:14 -0700 (PDT) From: cgel.zte@gmail.com X-Google-Original-From: xu.panda@zte.com.cn To: balbi@kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Xu Panda , Zeal Robot Subject: [PATCH linux-next] usb: dwc3: gadget: remove the unneeded result variable Date: Mon, 12 Sep 2022 10:28:55 +0000 Message-Id: <20220912102854.18277-1-xu.panda@zte.com.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Xu Panda Return the value power_supply_set_property() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Xu Panda --- drivers/usb/dwc3/gadget.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 3a344ba0b292..762a92470a01 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2868,7 +2868,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); @@ -2877,9 +2876,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); } /**