From: Martin Kaiser <martin@kaiser.cx>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
Phillip Potter <phil@philpotter.co.uk>,
Michael Straube <straube.linux@gmail.com>,
Pavel Skripkin <paskripkin@gmail.com>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH 1/6] staging: r8188eu: pass a struct recv_buf to rtw_read_port
Date: Mon, 6 Feb 2023 21:17:55 +0100 [thread overview]
Message-ID: <20230206201800.139195-2-martin@kaiser.cx> (raw)
In-Reply-To: <20230206201800.139195-1-martin@kaiser.cx>
The rtw_read_port function needs a struct recv_buf for preparing the usb
transfer.
Replace its u8 *rmem parameter with a struct recv_buf pointer to avoid
casts in the caller and in rtw_read_port.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
drivers/staging/r8188eu/hal/usb_halinit.c | 2 +-
drivers/staging/r8188eu/hal/usb_ops_linux.c | 9 ++++-----
drivers/staging/r8188eu/include/rtw_io.h | 2 +-
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index b7c9e5fd9a59..25fd6f8d814c 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -860,7 +860,7 @@ unsigned int rtl8188eu_inirp_init(struct adapter *Adapter)
/* issue Rx irp to receive data */
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
for (i = 0; i < NR_RECVBUFF; i++) {
- if (!rtw_read_port(Adapter, (unsigned char *)precvbuf)) {
+ if (!rtw_read_port(Adapter, precvbuf)) {
status = _FAIL;
goto exit;
}
diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c
index 9c940ab8fd41..225a422ede4f 100644
--- a/drivers/staging/r8188eu/hal/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c
@@ -364,7 +364,7 @@ static void usb_read_port_complete(struct urb *purb)
if (purb->status == 0) { /* SUCCESS */
if ((purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)) {
precvbuf->reuse = true;
- rtw_read_port(adapt, (unsigned char *)precvbuf);
+ rtw_read_port(adapt, precvbuf);
} else {
rtw_reset_continual_urb_error(adapter_to_dvobj(adapt));
@@ -376,7 +376,7 @@ static void usb_read_port_complete(struct urb *purb)
precvbuf->pskb = NULL;
precvbuf->reuse = false;
- rtw_read_port(adapt, (unsigned char *)precvbuf);
+ rtw_read_port(adapt, precvbuf);
}
} else {
skb_put(precvbuf->pskb, purb->actual_length);
@@ -396,7 +396,7 @@ static void usb_read_port_complete(struct urb *purb)
case -EPROTO:
case -EOVERFLOW:
precvbuf->reuse = true;
- rtw_read_port(adapt, (unsigned char *)precvbuf);
+ rtw_read_port(adapt, precvbuf);
break;
case -EINPROGRESS:
break;
@@ -406,10 +406,9 @@ static void usb_read_port_complete(struct urb *purb)
}
}
-u32 rtw_read_port(struct adapter *adapter, u8 *rmem)
+u32 rtw_read_port(struct adapter *adapter, struct recv_buf *precvbuf)
{
struct urb *purb = NULL;
- struct recv_buf *precvbuf = (struct recv_buf *)rmem;
struct dvobj_priv *pdvobj = adapter_to_dvobj(adapter);
struct recv_priv *precvpriv = &adapter->recvpriv;
struct usb_device *pusbd = pdvobj->pusbdev;
diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index 090555f562f2..6b1de4f0e287 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -19,7 +19,7 @@
int __must_check rtw_read8(struct adapter *adapter, u32 addr, u8 *data);
int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data);
int __must_check rtw_read32(struct adapter *adapter, u32 addr, u32 *data);
-u32 rtw_read_port(struct adapter *adapter, u8 *pmem);
+u32 rtw_read_port(struct adapter *adapter, struct recv_buf *precvbuf);
void rtw_read_port_cancel(struct adapter *adapter);
int rtw_write8(struct adapter *adapter, u32 addr, u8 val);
--
2.30.2
next prev parent reply other threads:[~2023-02-06 20:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-06 20:17 [PATCH 0/6] staging: r8188eu: remove intf_start and intf_stop Martin Kaiser
2023-02-06 20:17 ` Martin Kaiser [this message]
2023-02-06 20:17 ` [PATCH 2/6] staging: r8188eu: use standard error codes in rtw_read_port Martin Kaiser
2023-02-06 20:17 ` [PATCH 3/6] staging: r8188eu: use standard error codes in rtl8188eu_inirp_init Martin Kaiser
2023-02-06 20:17 ` [PATCH 4/6] staging: r8188eu: remove intf_start pointer Martin Kaiser
2023-02-06 20:17 ` [PATCH 5/6] staging: r8188eu: handle rtl8188eu_inirp_init errors Martin Kaiser
2023-02-06 20:18 ` [PATCH 6/6] staging: r8188eu: remove intf_stop pointer Martin Kaiser
2023-02-07 6:13 ` [PATCH 0/6] staging: r8188eu: remove intf_start and intf_stop Philipp Hortmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230206201800.139195-2-martin@kaiser.cx \
--to=martin@kaiser.cx \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=paskripkin@gmail.com \
--cc=phil@philpotter.co.uk \
--cc=straube.linux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®