From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A81A06D13 for ; Wed, 15 Sep 2021 21:11:34 +0000 (UTC) Received: by mail-ed1-f54.google.com with SMTP id v5so8457390edc.2 for ; Wed, 15 Sep 2021 14:11:34 -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=5zDbV/uKcczVbZMRuBNAgynLRQJTh3fUO/7zgmWU9yo=; b=lQNAzJlJDGcrs603ik5X5l1Tu7wfaSbtybECHiiME6GPiMlJ/lTxjC1L3zelPRZa8s F3EIbJiUlbKTjyEw/sfhz8W4OPj9U4h1R6SyxTxA6dg3y7BiyiojxbmyTdhD2/ptqNa/ 7MLPJPFyzvmJm3A6kH7+TrTP0FGmkMY/IhPv+2iU8PFzdOrwOAsde2LEj+s8vKzXTB6y IcdVOGO7TeBcRAttvdGpYMiYEhtaG5gSP2AWhxcAh0kK5TKirz7ZMAsHZDRCKxRxTp5O OsrVFTV7jWZwVarKmlw4fVlBgiIn7/smbDwPhQSh+266Lnmrr4pc3dcefx5LgEzFBauF gVNg== 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=5zDbV/uKcczVbZMRuBNAgynLRQJTh3fUO/7zgmWU9yo=; b=NZeYr6vvTn2/2kgwZ50LqBZs4mCTtDRBeu5DaJ/OP5J3OOdf722P4AwxgUquWVWX2O IPc8EPhCsfA7Iy8/6g3z5UI2gOqI0siK4vX6BQ6v0C+25SiuKO98aYXZ1rcL9fn8U67h bJ5u8jEyk7U0Vt+Nu6vjOfWZzZAe5OpVLW7IzR1SJo0Iwcf0hxsXBNUtJPWSwA39MFE2 2qsqj73fFUEcllSXzhhd0W6VwqesEd9bnbjnbmB2mXFGmkcKS3oI888tft75rE8apzVS pPPOkeqxToF+KiV/X7VIKVWcfchTujA/HxzRHEwgJ0nmQ/LazQx78fVZ53ET/8KqjxAr ym/w== X-Gm-Message-State: AOAM533SwAUTYpexx/78f78P5ub4S37X85cZuI8SNnXXnnQ7hIQY1IoA PkMbxrQzAkv7Cyw1xrY3Mmo= X-Google-Smtp-Source: ABdhPJzwjzqFhaVG3MjjNNRQsqfm6iLuTiYXCUpb0eGNHbvl/wKAIqJ0YC3YdVRQp3ROwD44st32SA== X-Received: by 2002:a17:907:3e21:: with SMTP id hp33mr2189383ejc.205.1631740293117; Wed, 15 Sep 2021 14:11:33 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Sep 2021 14:11:32 -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 12/19] staging: r8188eu: remove the helpers of usb_write_port_cancel() Date: Wed, 15 Sep 2021 23:10:56 +0200 Message-Id: <20210915211103.18001-13-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> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Pavel Skripkin Remove the unnecessary _rtw_write_port_cancel() and usb_write_port_cancel() and embed their code into the caller (i.e., rtw_write_port_cancel()). _rtw_write_port_cancel() is a mere redefinition of rtw_write_port_cancel() and it is unneeded. usb_write_port_cancel() was the only functions assigned to the (*_usb_write_port_cancel) 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 | 12 ------------ drivers/staging/r8188eu/hal/usb_ops_linux.c | 2 -- drivers/staging/r8188eu/include/rtw_io.h | 3 +-- drivers/staging/r8188eu/include/usb_ops_linux.h | 2 -- drivers/staging/r8188eu/os_dep/usb_ops_linux.c | 3 +-- 5 files changed, 2 insertions(+), 20 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_io.c b/drivers/staging/r8188eu/core/rtw_io.c index a57742057a65..74b02ff8e44d 100644 --- a/drivers/staging/r8188eu/core/rtw_io.c +++ b/drivers/staging/r8188eu/core/rtw_io.c @@ -93,18 +93,6 @@ u32 _rtw_write_port_and_wait(struct adapter *adapter, u32 addr, u32 cnt, u8 *pme return ret; } -void _rtw_write_port_cancel(struct adapter *adapter) -{ - void (*_write_port_cancel)(struct intf_hdl *pintfhdl); - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &pio_priv->intf; - - _write_port_cancel = pintfhdl->io_ops._write_port_cancel; - - if (_write_port_cancel) - _write_port_cancel(pintfhdl); -} - int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct _io_ops *pops)) { struct io_priv *piopriv = &padapter->iopriv; diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c index 1865a26142bc..2516cfc464a9 100644 --- a/drivers/staging/r8188eu/hal/usb_ops_linux.c +++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c @@ -562,8 +562,6 @@ void rtl8188eu_set_intf_ops(struct _io_ops *pops) { memset((u8 *)pops, 0, sizeof(struct _io_ops)); - pops->_write_port_cancel = &usb_write_port_cancel; - } void rtl8188eu_set_hw_type(struct adapter *adapt) diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h index 56e17e2a7ee2..4f4678a55687 100644 --- a/drivers/staging/r8188eu/include/rtw_io.h +++ b/drivers/staging/r8188eu/include/rtw_io.h @@ -265,7 +265,7 @@ void _rtw_write_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem); u32 rtw_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem); 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); +void rtw_write_port_cancel(struct adapter *adapter); #define rtw_write8_async(adapter, addr, val) \ @@ -276,7 +276,6 @@ void _rtw_write_port_cancel(struct adapter *adapter); _rtw_write32_async((adapter), (addr), (val)) #define rtw_write_port_and_wait(adapter, addr, cnt, mem, timeout_ms) \ _rtw_write_port_and_wait((adapter), (addr), (cnt), (mem), (timeout_ms)) -#define rtw_write_port_cancel(adapter) _rtw_write_port_cancel((adapter)) /* ioreq */ void ioreq_read8(struct adapter *adapter, u32 addr, u8 *pval); diff --git a/drivers/staging/r8188eu/include/usb_ops_linux.h b/drivers/staging/r8188eu/include/usb_ops_linux.h index 186c6b7628dc..641f059ffaf7 100644 --- a/drivers/staging/r8188eu/include/usb_ops_linux.h +++ b/drivers/staging/r8188eu/include/usb_ops_linux.h @@ -28,6 +28,4 @@ unsigned int ffaddr2pipehdl(struct dvobj_priv *pdvobj, u32 addr); -void usb_write_port_cancel(struct intf_hdl *pintfhdl); - #endif diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c index a98ffdf92ed4..4085f3e6067d 100644 --- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c +++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c @@ -211,10 +211,9 @@ u32 rtw_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem) return ret; } -void usb_write_port_cancel(struct intf_hdl *pintfhdl) +void rtw_write_port_cancel(struct adapter *padapter) { int i, j; - struct adapter *padapter = pintfhdl->padapter; struct xmit_buf *pxmitbuf = (struct xmit_buf *)padapter->xmitpriv.pxmitbuf; DBG_88E("%s\n", __func__); -- 2.33.0