Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp565277pxb; Sat, 21 Aug 2021 10:50:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYPrda4lo++DKu/0LuSfar6ysyphpZzLGvlWxcm1RPpFOJtr7QCXcHfRKdSoNVZyfH2KKI X-Received: by 2002:a6b:b512:: with SMTP id e18mr21240444iof.98.1629568204057; Sat, 21 Aug 2021 10:50:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629568204; cv=none; d=google.com; s=arc-20160816; b=wclrbBQMcbb2IIt5O6D8OpFEUHRp0CWjO84c96syKNtm/IYUxm4JlhP85vEIqhsqv4 bNDtQaNil3dNLSq1mEf33xQy60XxG+utNEP7jcgFcNpLj/Fu+NfPNXygBdI1Y1WvA332 0yrSgyw2TNd01WzKhJJaPWQKbyh4dUtXinWfN9ar80ckLBEioq1EDSCKjzats4YSxAhB BJZHet5UhCGry1yzWLSm4gFMxNR6iawCcgw1AsaYGqrnqbjLnjFDK00yu2NoGHuXAxkC X8wx5tPTHuZJfGIlcKS6B2NE7x3lcWE5voH07Gp6C8YMQp3rDTm9xT3LLGzBRKeXKsQp mxYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=weI7dEBVDoKQ1ZWV63hBImrE6uK/njMI0Jn4Use0aPk=; b=SHrdzRUxXi+mtu8QeW7CuRwuQjcwHceFigxy1xZo8x0viRX7DHZ40FXthvJH1/abkK jwSWmNOhIQvxdagA0I48jDXDGNa8QlD/d4S4rKjAwcFT2Knp0AObCHeKwpUkAzSwZRUn v4ek7Hj8MwtEwEq1bhJU8aIkYwRpe1V/fWXcG7rpuJwJzacD+UqGSUbS0t0BK4IBqKz3 3MiUYs1Fd/jKTGCJqb1uDteZ8Le9KagETGB1X8GzzF8g/+1Zn+sC7TneTYf8nXgYHHoh QYWNqVb4zWbdjjVZrZAymXO+vKm+a3C060xCyqtOYLqUaifA07OGPd7Bc4IjUxOVB4wW e43g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@philpotter-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=lJ9TbWcy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o12si2750565iow.40.2021.08.21.10.49.53; Sat, 21 Aug 2021 10:50:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@philpotter-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=lJ9TbWcy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234751AbhHURsU (ORCPT + 99 others); Sat, 21 Aug 2021 13:48:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230511AbhHURsT (ORCPT ); Sat, 21 Aug 2021 13:48:19 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1CCBC061575 for ; Sat, 21 Aug 2021 10:47:39 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id t42so8979960pfg.12 for ; Sat, 21 Aug 2021 10:47:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philpotter-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=weI7dEBVDoKQ1ZWV63hBImrE6uK/njMI0Jn4Use0aPk=; b=lJ9TbWcy2L0UP7e4OsNstGjZ+H124xT39Rs/HnWh8Bxcm3mEQDfdLn0CFdY2JwVGLA LHkIonRmmdXTUdyamI6V2MrEm4T4spCXQfDt8liYl+xDy4KIrAdEgvzVTQV8q0xpoANa b0+y+LuLyXp/7CXFE1zFNhIPue9ILwrZ87SXSZd/yO9JtOiFiggHwr8csRmgK9zO2XoI +Uk3+JjvZtmui2Yv5El1j/g6yJlSfa8vBkgyvyUmlWIIx1TOhYdD+Y1kvmedCgsS7Xwg rjLtS1TawSz1sE3M1xD8PX7ibMcCm/syaiMs4JxizvtwgDPihFMlJKuSW414/XWn+66p 9ibQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=weI7dEBVDoKQ1ZWV63hBImrE6uK/njMI0Jn4Use0aPk=; b=Y7qIDq62GCnrF++/BZpQHp2ggx19Gkc5ozL1593E3TkS9d/W6PXahNN872P3q7pPux VYB+qRoMJex79H44fi+M10R0vV2o4wpfXVu6ieo0NTpLFxfBM/e46UZWiU8AfBVPeAJj 7NK1PDB274kvZSZ3GCbuSK46gVQxVijFyuDCKUoCzqXCvxE0jkEBI5P1EF3+GksSphI3 Fh1RWk0qpyE/AMvQkPyu332BC0hp1S4+rrnK0KaevJCwi7OWQ1wnNd5wR4Rrh+ezUUrV 4BtrsXCAgFBuzMEnDNoMHRlE7h20xuWc3eCrCKmCV0rFOKo78uyT/yD2kWkfGeds/3fq +BYQ== X-Gm-Message-State: AOAM531JveCCpqoijfPbWsqLFlk2BRzRItXGBdjQKSbeZdHDg2BgJ7z5 EEJYfMF78yY7aoNrftQOVmnaO76UhIQurhsmc4WtTQ== X-Received: by 2002:a63:d910:: with SMTP id r16mr24184591pgg.318.1629568059462; Sat, 21 Aug 2021 10:47:39 -0700 (PDT) MIME-Version: 1.0 References: <20210821164859.4351-1-martin@kaiser.cx> <20210821164859.4351-10-martin@kaiser.cx> In-Reply-To: <20210821164859.4351-10-martin@kaiser.cx> From: Phillip Potter Date: Sat, 21 Aug 2021 18:47:28 +0100 Message-ID: Subject: Re: [PATCH 10/10] staging: r8188eu: set pipe only once To: Martin Kaiser Cc: Greg Kroah-Hartman , Larry Finger , Dan Carpenter , Michael Straube , linux-staging@lists.linux.dev, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 21 Aug 2021 at 17:50, Martin Kaiser wrote: > > Set the pipe for reading or writing in usbctrl_vendorreq only once. > There's no need to set it again for every retry. > > This patch is an adaptation of commit 889ed8b5e374 ("staging: rtl8188eu: > set pipe only once") for the new r8188eu driver. > > Signed-off-by: Martin Kaiser > --- > drivers/staging/r8188eu/hal/usb_ops_linux.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c > index 5408383ccec3..5a55ee38d7b8 100644 > --- a/drivers/staging/r8188eu/hal/usb_ops_linux.c > +++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c > @@ -40,15 +40,16 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u16 value, void *pdata, > goto release_mutex; > } > > - while (++vendorreq_times <= MAX_USBCTRL_VENDORREQ_TIMES) { > - memset(pIo_buf, 0, len); > + if (requesttype == REALTEK_USB_VENQT_READ) > + pipe = usb_rcvctrlpipe(udev, 0);/* read_in */ > + else > + pipe = usb_sndctrlpipe(udev, 0);/* write_out */ > > - if (requesttype == REALTEK_USB_VENQT_READ) { > - pipe = usb_rcvctrlpipe(udev, 0);/* read_in */ > - } else { > - pipe = usb_sndctrlpipe(udev, 0);/* write_out */ > + while (++vendorreq_times <= MAX_USBCTRL_VENDORREQ_TIMES) { > + if (requesttype == REALTEK_USB_VENQT_READ) > + memset(pIo_buf, 0, len); > + else > memcpy(pIo_buf, pdata, len); > - } > > status = usb_control_msg(udev, pipe, REALTEK_USB_VENQT_CMD_REQ, > requesttype, value, REALTEK_USB_VENQT_CMD_IDX, > -- > 2.20.1 > Acked-by: Phillip Potter Regards, Phil