Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp565104pxb; Sat, 21 Aug 2021 10:49:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzv60AEL0uHGl+B9AamLN1A8ayXCv6J6uWvK13dG6qmPL0Y8GrZ2gywqe/AwtfsqRqZIZTv X-Received: by 2002:a5d:87d2:: with SMTP id q18mr13794788ios.78.1629568181033; Sat, 21 Aug 2021 10:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629568181; cv=none; d=google.com; s=arc-20160816; b=lQ6FUkyhT9oY95SsHACdqTlCvbEwjwB8d9DGDcAw1DqZXCSjJPO1YA0CaNCegNEDPI WjbkeH3BQ52PJ8T3mm17t/afPoc9EknkKButwRXmupPm0Wk9kNp/9kAXiFDKNzg7cMDS av8jzKOBMuVpDQiIpT7iZP6cn7pL/crjD7PAbdEfioe9vcCuBSG7sB02hXLDTCHfwkMw Kp9foPzx2HpwhxTVH1HHFr4jUgp5TDRzaNL4/ls3VHnANvtc7+AIS4dyZVQc4hjgV6Of XKiWWChlXKdHK2JnHWlsaCejHSkDnKN4FYbM/yN/n+a+X8j+X9dLd9XjM9eK0mpLzhXJ cbbA== 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=vu1I56SlUB4H5MNFLJaRk7CI9dgtIkpJTCZCqyENsJo=; b=uZNOtt4iwAi057EHz/dWOWA7fqEqNMVaBOwc7cp3Suok8lVdq6LgVvjSpmxuvrm9P0 GcY+A/nd1uHeNEIcg5Wiff1VkTu7CsP4TdIyJudWHAxS4oOd9lWj16PaM6Hf/ggdfHvv M7NqnypMRdNwHgTRhArgij2joTWiEoFDOb0JhPl0xoBlvBYNBPEoXB3tc8yR/Aim/RR8 jlzONdjeM8lbFfMAX0nivTQULvsalBwvbVKIEeZaEiDFv2PxphDVu6l+5sECtJR3Gkcl 9X6VQNEXmkozsvvEXWhCmKBlEikzUDU3YW5OBzazJwjeELFZvfkPeqf1s72OBr5nKeVz Rmhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@philpotter-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=YQtkT+tq; 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 j10si10695116jat.46.2021.08.21.10.49.30; Sat, 21 Aug 2021 10:49:41 -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=YQtkT+tq; 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 S234241AbhHURrV (ORCPT + 99 others); Sat, 21 Aug 2021 13:47:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbhHURrU (ORCPT ); Sat, 21 Aug 2021 13:47:20 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F35BFC061575 for ; Sat, 21 Aug 2021 10:46:40 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id j10-20020a17090a94ca00b00181f17b7ef7so3098257pjw.2 for ; Sat, 21 Aug 2021 10:46:40 -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=vu1I56SlUB4H5MNFLJaRk7CI9dgtIkpJTCZCqyENsJo=; b=YQtkT+tqoJxn4EavjELNpI1oc5ZqmnIjhVgEVh3HZhAjpHmtNBTgxaVRTKa3P29cAT WgqdWaMOff58vgruNGhX6SVoq3gnSnEFp93qt5XWEPWuWGOgzsT8vVyBGfDm4Jnf2/Bk xYlNmMfdfy4VpNcvLyQj5EkSdUFVnZ9UJ17kyOddD39NYb+AH470I6LSaZHG0IWQn+02 b22Cp3yU1k17GTOJPeyO4d6zDz4b7Lu/iK2fUTMCVG5ossfDjEyIqz5ByBHlEULc1Ni4 Zxguhc4/BYDcV1cDp7l6gKJJPYa/4UQwHTc1I0noFAXalRgMmSP028zScaWvp1bkJ8JO OX4g== 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=vu1I56SlUB4H5MNFLJaRk7CI9dgtIkpJTCZCqyENsJo=; b=CB98yr+p4pZNC8XJwG8dhfSyBOB7Qy2JB5pyrjA8RpXp1R/+DPnjjMNoGwN9mdH0mu qCrLmKnBKpi6Xlq0PFsThwk3xf5L9h9diF3+PcoUWkVI017BG5fXHQEd4/+6oDRuS/O4 ZGd2OSNyte68u4hkjVphQi6zS9cnjJUZavVzNMztKnx8TKTwwe1mqXbGevSIJKy98YQs v22XEF5qyAfpVhmY8294FMcQWNWPRIO6v0Qu/c4mkZeOB/fFfik3Vgz9+LEnLdZQ7PZQ CnMoqpfzhjfXHABev1ao6Pw0h6RHLajUIvbCTTXI7lIJq6aO04Fp7VTp2V/GCiLqqwvu bnSw== X-Gm-Message-State: AOAM532LAu8CN8yCHPop7U0kegw2htGrJRioSEcSXIT3lGU+vnIOXXi1 qZj8u3hcJRl+v9jzW0fX2oeioOwDF7HNMZNZD1BK0A== X-Received: by 2002:a17:90a:1b2e:: with SMTP id q43mr10969934pjq.217.1629568000545; Sat, 21 Aug 2021 10:46:40 -0700 (PDT) MIME-Version: 1.0 References: <20210821164859.4351-1-martin@kaiser.cx> <20210821164859.4351-7-martin@kaiser.cx> In-Reply-To: <20210821164859.4351-7-martin@kaiser.cx> From: Phillip Potter Date: Sat, 21 Aug 2021 18:46:29 +0100 Message-ID: Subject: Re: [PATCH 07/10] staging: r8188eu: clean up the usb_writeXY functions 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:49, 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) > -- > 2.20.1 > Acked-by: Phillip Potter Regards, Phil