Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1138728pxb; Sun, 22 Aug 2021 07:06:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7M4xa37AHSGJRGfeuTm7Mezx6btSCiDFJSGxUsU3C3fqbay4I9ZH1TePh/ooUpjTfdvYf X-Received: by 2002:a02:1d04:: with SMTP id 4mr25156762jaj.98.1629641219208; Sun, 22 Aug 2021 07:06:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629641219; cv=none; d=google.com; s=arc-20160816; b=A/5Rb4HhyLs2C58eRgii6c82ClyEa7RfgW+cHJ4t7NIvZkCscutxpnuhnPpJkUQDTh 6CZ+BJItXqm5kybRKe7ZnAaKcnQSn8mNa0ve/jp2BOz7d8rP5JcOG5SLJ1gCNPZPtJ7k vNN+blJoRvN0sd4PMGNcZ2oCDTkn3cM53O4GosnRh/ZD2nRFdHVQZZ5MCt3Phtc0Ccc+ zlzpamo1iiHZWyY30IBZNl2jR017DO4M+CiozY8y7ypMb1Cy5M6/AwrcMQs+CA0rXX1q iWv5bSu7OTcEzHeq2QQMRT0TuVON1ZAmsne/G3AqNzrIfEqHLJL+/dNBLnkVnjHC7kxS LDtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=p7ph3WcOBLhIzLLXreA5sxLtbJ/7/kTwoO02MA088Jk=; b=fXgSFsVK81lYC5p3G29lw6i1w39GzsHTQN/7H8OGfE3GmsZWxgWjCRzRNt38FI8SIf t0ChPNYSP16ah8AbrpvRlKheB8gVOkY+R1PMBBKxmrtPnpmqoIB9ApMrPXWt7bwO5sxi tzRahohYeanmSzWZtjQFB/PpyJM5NHyFPYkG1dL/N9G2CQxPAyZZGWVEIxSI82CNbSSX kUQsK3oqWylm3HHFosluo4DkaUazS3BndzfZqV67Cx+0xnN0iaQ5jkCjS1z31iTZ1t8u ek6qAm/vBNiOpD/2JcY8z2ah+HZtPwevfm7yFdvUBJcd39s9YW3hBDQwObtyxkVr4Kj+ 8fTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=esvH4DB7; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q7si13069668ilu.111.2021.08.22.07.06.45; Sun, 22 Aug 2021 07:06:59 -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=@gmail.com header.s=20161025 header.b=esvH4DB7; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232043AbhHVOGp (ORCPT + 99 others); Sun, 22 Aug 2021 10:06:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbhHVOGo (ORCPT ); Sun, 22 Aug 2021 10:06:44 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6344BC061575 for ; Sun, 22 Aug 2021 07:06:03 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id z9so21918058wrh.10 for ; Sun, 22 Aug 2021 07:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=p7ph3WcOBLhIzLLXreA5sxLtbJ/7/kTwoO02MA088Jk=; b=esvH4DB7Y0QbmDJBfJhGYqLk+7oDXzoCRsI/j0NfluAIVS17q9u56DM3wQAysgTQL+ 5eJYqzEcBbNpvXRTN8lXm2/x9YlrXL0Dx0RZ1U7ezRdGgbdz2qOMz5ViaBThSa4MXy0V 56JyuufHqxaTF6KhJbeIhQySqpIaVax6Z4Giv22FrmxpznwHLXV4dTuxLYIFvKMKhwZu ly1icmr2l0DMH7aFYzE82taNHSggZMRHQmbwmQPcOGZzOP1r8mV+LYw/NEBQGS2hQhbP Ec88ezHiYlyi/FBefl4T5VfWFImeis4tu+4EBk8BdSaJWp/9/DtPTdH0OYiY5HKOoZgi ircw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=p7ph3WcOBLhIzLLXreA5sxLtbJ/7/kTwoO02MA088Jk=; b=WtGoGuaaC9Csmr/jgIJ5zVFj5bvvomh3GKJ7JZSUVcWpp9ETUa1zUsAllJSYfn242p T+KRRIdFMr2BpqWE7ruVdpmma/9AVytCQEly05u3/9Y/ey46rKHKhLooW76+HxqoVK/M 7dBx8rWoN9GVq0G7C+qT4N+gD/ZANtwbTBbNGewUt4W0086aUwZfjg6/PVieiIIMeDnD FkADSuDQePVnP1vlNspwkAyT7yqWVF9osUTajwTyDQsywhigl8bJQgn2PQhdhjqQtBUy m+j9dKOCj3gnMdn2K0KpsxPOMc1EtIs8VUvhcSTkNSkI5zzec2x2uSb3P/PJFbWpWHiB zd7w== X-Gm-Message-State: AOAM532Z8w2ElTaoRjOXp3lHUtx++T9FREDpedBN8ut7Er5V5VKbJzNf VUUympyov4PJPmZ0FI1rKxjccT8cxJs= X-Received: by 2002:a5d:456a:: with SMTP id a10mr8726291wrc.339.1629641162075; Sun, 22 Aug 2021 07:06:02 -0700 (PDT) Received: from ?IPv6:2a02:8108:96c0:3b88::687e? ([2a02:8108:96c0:3b88::687e]) by smtp.gmail.com with ESMTPSA id b15sm12363863wrq.5.2021.08.22.07.06.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Aug 2021 07:06:01 -0700 (PDT) Subject: Re: [PATCH 10/10] staging: r8188eu: set pipe only once To: Martin Kaiser , Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Dan Carpenter , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org References: <20210821164859.4351-1-martin@kaiser.cx> <20210821164859.4351-10-martin@kaiser.cx> From: Michael Straube Message-ID: <088d6fbb-b231-e669-1f0d-5adea7ac4685@gmail.com> Date: Sun, 22 Aug 2021 16:05:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210821164859.4351-10-martin@kaiser.cx> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/21/21 6:48 PM, 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, > Looks good to me. Acked-by: Michael Straube Thanks, Michael