Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1078446pxb; Sun, 22 Aug 2021 05:27:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUhUKyFy/AFNJ+ZeuwscHekfWj3hPbX/JGBH9YvhEIJR9OjJpBO2f2hfCxxxlDdsE3t0aW X-Received: by 2002:a5d:898f:: with SMTP id m15mr22955705iol.188.1629635273911; Sun, 22 Aug 2021 05:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629635273; cv=none; d=google.com; s=arc-20160816; b=AiA74qVth8mHOuyJ4eI+qaVqYrG8Ili6r30U1cwe2z2Vmt29NgQIUSkIzQdm2hUy4B 0+l/BKMaPdBReO6+lFwN83AhozLbS9H1m1do4FCZO6Zy20m8BssPteoYCI0RP4obS+AO vEvP9BfIOnzfEafCjnvnNVPt/RGsunJM3jG1Pw0+fit0sIcxMBZ1VSDhoceRVFmfXCG0 zDfC5xPiXm2G+tvHSIC+AqfLLUF8UqAqQhW8qFPT2JHaOtu3hRhocfaEWX4oql/G19QT Nlgs773dIStmipyX5A06ikMPDlhh9mgkNY+DxR6pWsqny1572GuW6iCBpldRrrVltqzQ hk2w== 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=T7fSKli+UNhh3LDQln8Jkh3y6lz/VRyR8HfJLUjKlNA=; b=eazGMiBlQ7C27dC7k9wZrt5WdAypbDFMLK+vAUER7/JCcZT7kpC8hew4o97PnkXpjG PwqB8zs/DG+X1CJdebIInv3IivGZjDzfGkdMos1LV5zpJKYX1ND1o4DApVSl2i4dx7i7 0uZZ6gk99PxoBmaY0bTapx6uXbtCS/F08Zf9FXUNAARKCPvV9LM66awn4CnRq+1AzDVY YynfVQTLKo0Sd65J2HI8hHjwi2DukoQcKP6xMt5EL9p2T35cXBjJXpWDZro5syD/oTve AtHDML2O2gKGg+Uac/3QmSGA1S8XtFRYww9s79ftI/0AxQLu0+/JItgpevQiElRNhCbR pgRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FBK1FL8f; 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.27.42; Sun, 22 Aug 2021 05:27:53 -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=FBK1FL8f; 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 S231492AbhHVM0m (ORCPT + 99 others); Sun, 22 Aug 2021 08:26:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231130AbhHVM0m (ORCPT ); Sun, 22 Aug 2021 08:26:42 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B116C061575 for ; Sun, 22 Aug 2021 05:26:01 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id u16so21730784wrn.5 for ; Sun, 22 Aug 2021 05:26:01 -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=T7fSKli+UNhh3LDQln8Jkh3y6lz/VRyR8HfJLUjKlNA=; b=FBK1FL8fNHSQq1gCBSj6Ap9Osp+vqwiW2nN/mJ7UHg0KhPNhgMpgOjTADqc8ZjZ5y/ aYiyt3HdzP++MSArOyajt5fIKzW3CPOCQOEbqweJB/+FtkmFe1JxZHcvLJsdYxhGr/Lx 3FmFIpJZzoTOSvH35pgae4Rrffu85OVgXgMRF7Fcm+O5EYWUrcAQvA4+pGqmeUwPaEnZ iBmsSp3FugzE4PaEt8gylxyClQLcSnHMZSLLOT1clfwYIjpTBZlECEBRCaWcbouo0oJ2 /1V/VIh1gkBXLTgCfodAh8KXMLKk1280XBWoNb1ipDEDSNCQLEWLw86zarhw7b1SBNhf ghUw== 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=T7fSKli+UNhh3LDQln8Jkh3y6lz/VRyR8HfJLUjKlNA=; b=HJOuFqgndTGJtsnLS0tpLZVEzcJ5n+ZlrmxbznJvwy7ajitwJlJhmvPrhAkgH6GSVw MGZ2Xk6nihgbsgaqrVDFVHqpGmANurAfhV+sIFMlu3367T+34YyLlVhWOfLNT8MV4qC3 fhv4mlEQIWLgt57UQBWuy/BDTqYqeJ5RurgiaGlYiFgNw5qVSye9UbG5J1WPIUVG9soj +TT9ukNT4+kn6FZMBbM1ERuojQ6xFFwEQ00b5ms8IFkMv5MDMQGv73MO9BK9eMDBFupV n8kbzWtertftzD5/E61Uncw/+GI95oYhR9PJLuT+GySTKkn218Q4nnlJff/FFMK/W1Hu 9XLg== X-Gm-Message-State: AOAM531GZSGi6v6XW4wgLzbBv+gB4ak5iMYrz7H9jM9We+u9HcFf6kqT diKb5064XLehNK0ojdmvn/Id82fRJsw= X-Received: by 2002:a5d:49cd:: with SMTP id t13mr8396394wrs.217.1629635160105; Sun, 22 Aug 2021 05:26:00 -0700 (PDT) Received: from ?IPv6:2a02:8108:96c0:3b88::687e? ([2a02:8108:96c0:3b88::687e]) by smtp.gmail.com with ESMTPSA id x11sm4386842wro.83.2021.08.22.05.25.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Aug 2021 05:25:59 -0700 (PDT) Subject: Re: [PATCH 06/10] staging: r8188eu: clean up the usb_readXY 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-6-martin@kaiser.cx> From: Michael Straube Message-ID: Date: Sun, 22 Aug 2021 14:25:10 +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-6-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 | 30 +++++---------------- > 1 file changed, 7 insertions(+), 23 deletions(-) > > diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c > index dccb9fd34777..cb969a200681 100644 > --- a/drivers/staging/r8188eu/hal/usb_ops_linux.c > +++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c > @@ -98,46 +98,30 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u16 value, void *pdata, > > static u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr) > { > - u16 wvalue; > - u16 len; > - u8 data = 0; > - > - > - > - wvalue = (u16)(addr & 0x0000ffff); > - len = 1; > - > - usbctrl_vendorreq(pintfhdl, wvalue, &data, len, REALTEK_USB_VENQT_READ); > - > + u16 wvalue = (u16)(addr & 0x0000ffff); > + u8 data; > > + usbctrl_vendorreq(pintfhdl, wvalue, &data, 1, REALTEK_USB_VENQT_READ); > > return data; > - > } > > static u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr) > { > - u16 wvalue; > - u16 len; > + u16 wvalue = (u16)(addr & 0x0000ffff); > __le32 data; > > - wvalue = (u16)(addr & 0x0000ffff); > - len = 2; > - usbctrl_vendorreq(pintfhdl, wvalue, &data, len, REALTEK_USB_VENQT_READ); > + usbctrl_vendorreq(pintfhdl, wvalue, &data, 2, REALTEK_USB_VENQT_READ); > > return (u16)(le32_to_cpu(data) & 0xffff); > } > > static u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr) > { > - u16 wvalue; > - u16 len; > + u16 wvalue = (u16)(addr & 0x0000ffff); > __le32 data; > > - wvalue = (u16)(addr & 0x0000ffff); > - len = 4; > - > - usbctrl_vendorreq(pintfhdl, wvalue, &data, len, REALTEK_USB_VENQT_READ); > + usbctrl_vendorreq(pintfhdl, wvalue, &data, 4, REALTEK_USB_VENQT_READ); > > return le32_to_cpu(data); > } > Looks good to me. Acked-by: Michael Straube Thanks, Michael