From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 086DCC4338F for ; Sun, 22 Aug 2021 12:26:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D54B56120C for ; Sun, 22 Aug 2021 12:26:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231571AbhHVM0n (ORCPT ); Sun, 22 Aug 2021 08:26:43 -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-Google-Smtp-Source: ABdhPJyaUoGaLCl96GnyolGyPnFrfkYmoWgVBeON8SM1TyUuJcwolju3RU7XbBckEzWk4XPWoM9rVA== 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