Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1081231pxb; Sun, 22 Aug 2021 05:31:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJ9e6cKnapT2yUOHOyF9zTHC3jIPZbjaK9+rnhhsLx3ekDseqYCPclzVdslL7A/toJjY7R X-Received: by 2002:a92:4453:: with SMTP id a19mr19390367ilm.221.1629635488904; Sun, 22 Aug 2021 05:31:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629635488; cv=none; d=google.com; s=arc-20160816; b=CQM+s5hgrVYNapyJ1ElBqgYvFBd84VX3CdVHoI1KRBckAUYhB77KXdLwbG76MqE5It Zsu5p7DR2zH8gdoPtgSbzTv+Kjx/AAEeagyWaZP6Y9gDO9Am6oRN5zUAUzXjlQj31IH3 MAJi1O86rMNaEY7Jfew02zyP+JKgvJgyexoXGdn8XXTT6ge10ql5mbwEAqmGayLsWVgz ZfSVyBZdE54614pokclnMuAdV1y7YNiHAl3QuuWPmm4xjDjasOcG6TE47aAmbsyQtZfb vyKs1p5Pw0ynWsBFv/K8LMVVJqylP7UNXTPzhYeHDWfOgL/OutveR9c5EqYFLySi3cdn mzoQ== 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=1jPp7QEaPt1Sw5YHA6F6IZfCBjiMiNjX+vQKALZJ4QI=; b=UcB5bgnnhjF3utVI3sFVg7OvxCqleSMzyonbjwWOHGcfMqck8R5mbGndE5T6knSewe oJk/c42pITih0Vv1FuwiTyXSYHZRlFP/jAscvsRkkt1EwsfTqyHsKe2SkPYXZx/u64xo 4P7Ps5K04oOtiEMLuxsfS18XyxiHc6p55C90PhgW/PmLso5Q0SxbmfS2TxI5FJuQlLPM v9YPmpUEV2dkIlgDQ/O58KmRcrfzT1klEvAtYL4/ZGKDRYpz3RB2WTalVhT+P38T/2+A vZM3c3bpghxjvohWk9qXKPA+KXbe36KweMDULR+56TYbXwGWisVgGV3JmlAcGUSYW1qK M7ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eVg11WaV; 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 h14si13920335jav.71.2021.08.22.05.31.17; Sun, 22 Aug 2021 05:31:28 -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=eVg11WaV; 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 S231356AbhHVM3b (ORCPT + 99 others); Sun, 22 Aug 2021 08:29:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230499AbhHVM3a (ORCPT ); Sun, 22 Aug 2021 08:29:30 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADC82C061575 for ; Sun, 22 Aug 2021 05:28:49 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id u1so8788419wmm.0 for ; Sun, 22 Aug 2021 05:28:49 -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=1jPp7QEaPt1Sw5YHA6F6IZfCBjiMiNjX+vQKALZJ4QI=; b=eVg11WaVtYLB5ceZ8giZlV2tN6dioW/R3JazFuYxWaaNoCVeNxUnIeDAZ+VO4+AN6u uz4ViYuelrrHtsvEtK2ICH59/xo1VIkmd7FWdK8LJk6/EsmvqeptAHb5hNHcenN869i0 g0we1hZpBpBa8BXy1gNpRdpU09ZaFGtvuRNAu1H0Yn28nHm8afXs05JDSL02e9vxCfm/ HOApYjzLF3J9sInBiEO6Umb3QWi+WCJt1jm1wx0uJ5urh8lir+f5uNm+QPegCTVJDfX1 kWbaD5BSdP/iecviZ9AyuLHtAK6Zu4z5ZF7gYWTGvDY//FvQhBSHLpxE1MJ0E+ufTGtF mZNA== 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=1jPp7QEaPt1Sw5YHA6F6IZfCBjiMiNjX+vQKALZJ4QI=; b=Ja9FUPY25E5tBe6ysVmr87ZZtffJVQVaSOMIGsvkiRmXD120BhoHG3KM2KhLrNOQZA pADfbI4jJf8uuUqVcqWfg06l7BAUCY1yzO1h/e5+7MPcEjNZYUYVefG7C7D9CT3iM8hl xrJaiHAuP0W5kAJmbpxTfbyKScM/FDSwxEkDXfFRFVdYWObjSIXt9OmPGKg5R2o4zZfr JffGcUfR8SQIXzza4Murfhcs4kw0cUHLNGwCCt0zzKwnlqLsEJxM+StdMjNlWYte7+0c DZBpRvH2Vmn7YOzXxrnHWxu6OnznX3cukK+0zhhkCSJ1Jp1Mg/b1RifUpG8jXybwkOT9 LI7Q== X-Gm-Message-State: AOAM530JATqlFeqoCjsA87bub2IcAu/PUNoHpiHBiTLeklzNs3KylfCF aJPHW3mpT/kXkPzDTyG5vpbGinbXDt0= X-Received: by 2002:a7b:c5d8:: with SMTP id n24mr12230151wmk.51.1629635327606; Sun, 22 Aug 2021 05:28:47 -0700 (PDT) Received: from ?IPv6:2a02:8108:96c0:3b88::687e? ([2a02:8108:96c0:3b88::687e]) by smtp.gmail.com with ESMTPSA id n15sm500015wrv.48.2021.08.22.05.28.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Aug 2021 05:28:47 -0700 (PDT) Subject: Re: [PATCH 07/10] staging: r8188eu: clean up the usb_writeXY functions 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-7-martin@kaiser.cx> From: Michael Straube Message-ID: Date: Sun, 22 Aug 2021 14:27:58 +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-7-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: > Remove unnecessary variables, summarize declarations and assignments. > > Signed-off-by: Martin Kaiser > --- > drivers/staging/r8188eu/hal/usb_ops_linux.c | 50 ++++----------------- > 1 file changed, 8 insertions(+), 42 deletions(-) > > diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c > index cb969a200681..e01f1ac19596 100644 > --- a/drivers/staging/r8188eu/hal/usb_ops_linux.c > +++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c > @@ -128,59 +128,25 @@ static u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr) > > static int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val) > { > - u16 wvalue; > - u16 len; > - u8 data; > - int ret; > - > - > - wvalue = (u16)(addr & 0x0000ffff); > - len = 1; > - data = val; > - ret = usbctrl_vendorreq(pintfhdl, wvalue, &data, len, REALTEK_USB_VENQT_WRITE); > + u16 wvalue = (u16)(addr & 0x0000ffff); > > - return ret; > + return usbctrl_vendorreq(pintfhdl, wvalue, &val, 1, REALTEK_USB_VENQT_WRITE); > } > > static int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val) > { > - u16 wvalue; > - u16 len; > - __le32 data; > - int ret; > - > - > - > - wvalue = (u16)(addr & 0x0000ffff); > - len = 2; > - > - data = cpu_to_le32(val & 0x0000ffff); > - > - ret = usbctrl_vendorreq(pintfhdl, wvalue, &data, len, REALTEK_USB_VENQT_WRITE); > - > - > + u16 wvalue = (u16)(addr & 0x0000ffff); > + __le32 data = cpu_to_le32(val & 0x0000ffff); > > - return ret; > + return usbctrl_vendorreq(pintfhdl, wvalue, &data, 2, REALTEK_USB_VENQT_WRITE); > } > > static int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val) > { > - u16 wvalue; > - u16 len; > - __le32 data; > - int ret; > - > - > - > - wvalue = (u16)(addr & 0x0000ffff); > - len = 4; > - data = cpu_to_le32(val); > - > - ret = usbctrl_vendorreq(pintfhdl, wvalue, &data, len, REALTEK_USB_VENQT_WRITE); > - > - > + u16 wvalue = (u16)(addr & 0x0000ffff); > + __le32 data = cpu_to_le32(val); > > - return ret; > + return usbctrl_vendorreq(pintfhdl, wvalue, &data, 4, REALTEK_USB_VENQT_WRITE); > } > > static int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata) > Looks good to me. Acked-by: Michael Straube Thanks, Michael