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=-15.7 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,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 41AC4C4332F for ; Wed, 15 Sep 2021 21:11:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A2AB60F8F for ; Wed, 15 Sep 2021 21:11:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232329AbhIOVMn (ORCPT ); Wed, 15 Sep 2021 17:12:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232258AbhIOVMk (ORCPT ); Wed, 15 Sep 2021 17:12:40 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26473C061574 for ; Wed, 15 Sep 2021 14:11:21 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id g8so8580121edt.7 for ; Wed, 15 Sep 2021 14:11:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=goMrrM9FMD/IXaI9vW819fp2kbhVZpXVLGWgpJIONdA=; b=cADi/52/htZ2jnDzgaPu+xgaFuGGFD4M2SOxwxFPLoBosZdpoicCD0Mx1T7xKortGo jjSv77xV/kLEAiImW7zjVWU6ayHMJSuiIcqFfX82G14qCK11JRZIu4KHOfJyURL4Ybmy j2fI1M+Xnv2MMLiewGMVH+y6IKmWdtQ9724QHKAGvonD0tD7QvLB1ShMBESEWJd/cYQT QKckAend1vv4ANaNhTEXmUis9lWQ8f+aslWmc8EV353luhRxHkf0zxpvCrPHLtdqrlDj rGUgKBbEsRlFlOwdaxRkgAoAkA+XB7sLJR7eMrad5PsbmyKnZ47E2saUrbQbGSfnb5Mn BA1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=goMrrM9FMD/IXaI9vW819fp2kbhVZpXVLGWgpJIONdA=; b=NH5BucjuA8s0WqxxT1bBuV5NFaiXWHS+SiZivYmFQcy6xtjG+a5GmerpmKcd+2eUr8 /QBBVufLpcEn0kCFz6dDZsahIPbkmLNYKTpsmbdZFCMIGfJpEjz7XUIPNgZ7gpscTAwK H+3ohcTnLaK8zdWaNwGeryQf9kILyGNmbiP2AmO/R2iWUOQUSNPVmIwFKnf+uOzN1O3v ooOFxwRpETyFbojG/K1vwj+IlO76yI1ydwEVevP5xxr4icsbHva86PvaspSla+BtQsOm 9Dfn5wRPQGO1fSEzGpF+QSIQj7pdsMoGxXlE5ZpdY/r8WqlVJs+Mwy46gZs8MR3iKwsN UpQQ== X-Gm-Message-State: AOAM532aGCEzNuJKqegEJMH5upcv0p3DVObmjwDBtldmHAyy/DHokpxi t54y/pm6EM3bHqdMCAVsI6s= X-Google-Smtp-Source: ABdhPJxWpuQ9kcftot78E0LDCd3wiKQOswc3d6eVQUNZyeHLooTn+avYPvEMLW5Y1tSl3XORFQzYXw== X-Received: by 2002:aa7:ce14:: with SMTP id d20mr2264429edv.132.1631740279731; Wed, 15 Sep 2021 14:11:19 -0700 (PDT) Received: from localhost.localdomain (host-95-235-105-169.retail.telecomitalia.it. [95.235.105.169]) by smtp.gmail.com with ESMTPSA id t3sm511618edt.61.2021.09.15.14.11.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Sep 2021 14:11:19 -0700 (PDT) From: "Fabio M. De Francesco" To: Larry Finger , Phillip Potter , Greg Kroah-Hartman , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, David Laight , Dan Carpenter Cc: "Fabio M . De Francesco" Subject: [PATCH v6 02/19] staging: r8188eu: remove the helpers of rtw_read8() Date: Wed, 15 Sep 2021 23:10:46 +0200 Message-Id: <20210915211103.18001-3-fmdefrancesco@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210915211103.18001-1-fmdefrancesco@gmail.com> References: <20210915211103.18001-1-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Skripkin Remove the unnecessary _rtw_read8() and usb_read8() and embed their code into the caller (i.e., rtw_read8()). _rtw_read8() is a mere redefinition of rtw_read8() and it is unneeded. usb_read8() was the only functions assigned to (*_usb_read8) pointer, so we can simply remove it and make a direct call. This patch is in preparation for the _io_ops structure removal. Co-developed-by: Fabio M. De Francesco Signed-off-by: Fabio M. De Francesco Signed-off-by: Pavel Skripkin --- drivers/staging/r8188eu/core/rtw_io.c | 14 -------------- drivers/staging/r8188eu/hal/usb_ops_linux.c | 5 +++-- drivers/staging/r8188eu/include/rtw_io.h | 3 +-- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_io.c b/drivers/staging/r8188eu/core/rtw_io.c index e6f377377ab2..4c43b6d00178 100644 --- a/drivers/staging/r8188eu/core/rtw_io.c +++ b/drivers/staging/r8188eu/core/rtw_io.c @@ -34,20 +34,6 @@ jackson@realtek.com.tw #define rtw_cpu_to_le16(val) cpu_to_le16(val) #define rtw_cpu_to_le32(val) cpu_to_le32(val) -u8 _rtw_read8(struct adapter *adapter, u32 addr) -{ - u8 r_val; - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &pio_priv->intf; - u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr); - - - _read8 = pintfhdl->io_ops._read8; - r_val = _read8(pintfhdl, addr); - - return r_val; -} - u16 _rtw_read16(struct adapter *adapter, u32 addr) { u16 r_val; diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c index 7f30b00b3ce6..8389deeb1182 100644 --- a/drivers/staging/r8188eu/hal/usb_ops_linux.c +++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c @@ -97,8 +97,10 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u16 value, void *pdata, return status; } -static u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr) +u8 rtw_read8(struct adapter *adapter, u32 addr) { + struct io_priv *pio_priv = &adapter->iopriv; + struct intf_hdl *pintfhdl = &pio_priv->intf; u16 wvalue = (u16)(addr & 0x0000ffff); u8 data; @@ -538,7 +540,6 @@ void rtl8188eu_set_intf_ops(struct _io_ops *pops) { memset((u8 *)pops, 0, sizeof(struct _io_ops)); - pops->_read8 = &usb_read8; pops->_read16 = &usb_read16; pops->_read32 = &usb_read32; pops->_read_port = &usb_read_port; diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h index 5ef89c72cc83..9dc32f7bcae8 100644 --- a/drivers/staging/r8188eu/include/rtw_io.h +++ b/drivers/staging/r8188eu/include/rtw_io.h @@ -245,7 +245,7 @@ void unregister_intf_hdl(struct intf_hdl *pintfhdl); void _rtw_attrib_read(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem); void _rtw_attrib_write(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem); -u8 _rtw_read8(struct adapter *adapter, u32 addr); +u8 rtw_read8(struct adapter *adapter, u32 addr); u16 _rtw_read16(struct adapter *adapter, u32 addr); u32 _rtw_read32(struct adapter *adapter, u32 addr); void _rtw_read_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem); @@ -267,7 +267,6 @@ u32 _rtw_write_port_and_wait(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem, int timeout_ms); void _rtw_write_port_cancel(struct adapter *adapter); -#define rtw_read8(adapter, addr) _rtw_read8((adapter), (addr)) #define rtw_read16(adapter, addr) _rtw_read16((adapter), (addr)) #define rtw_read32(adapter, addr) _rtw_read32((adapter), (addr)) #define rtw_read_port(adapter, addr, cnt, mem) \ -- 2.33.0