driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: vt6656: Fix vnt_tx_usb_header static checker warning
@ 2020-05-23 23:12 Malcolm Priestley
  2020-05-26 13:50 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Malcolm Priestley @ 2020-05-23 23:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: devel, linux-wireless, dan.carpenter

drivers/staging/vt6656/rxtx.c:729 vnt_beacon_xmit()
warn: struct type mismatch 'vnt_beacon_buffer vs vnt_tx_usb_header'

Since the only part of vnt_beacon_buffer is used remove and
replace it with vnt_tx_usb_header.

Fixes: 9deca1e3e2b6 ("staging: vt6656: vnt_beacon_xmit use extra_tx_headroom.")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6656/rxtx.c | 12 ++++++------
 drivers/staging/vt6656/rxtx.h |  5 -----
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 9ee57f7c0c88..a1b16ef9b27f 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -634,7 +634,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
 
 static int vnt_beacon_xmit(struct vnt_private *priv, struct sk_buff *skb)
 {
-	struct vnt_beacon_buffer *beacon_buffer;
+	struct vnt_tx_usb_header *usb;
 	struct vnt_tx_short_buf_head *short_head;
 	struct ieee80211_tx_info *info;
 	struct vnt_usb_send_context *context;
@@ -701,13 +701,13 @@ static int vnt_beacon_xmit(struct vnt_private *priv, struct sk_buff *skb)
 	if (priv->seq_counter > 0x0fff)
 		priv->seq_counter = 0;
 
-	beacon_buffer = skb_push(skb, sizeof(struct vnt_tx_usb_header));
-	beacon_buffer->usb.tx_byte_count = cpu_to_le16(count);
-	beacon_buffer->usb.pkt_no = context->pkt_no;
-	beacon_buffer->usb.type = 0x01;
+	usb = skb_push(skb, sizeof(*usb));
+	usb->tx_byte_count = cpu_to_le16(count);
+	usb->pkt_no = context->pkt_no;
+	usb->type = 0x01;
 
 	context->type = CONTEXT_BEACON_PACKET;
-	context->tx_buffer = beacon_buffer;
+	context->tx_buffer = usb;
 	context->buf_len = skb->len;
 
 	spin_lock_irqsave(&priv->lock, flags);
diff --git a/drivers/staging/vt6656/rxtx.h b/drivers/staging/vt6656/rxtx.h
index fd64d0838e34..f3c7b99cda73 100644
--- a/drivers/staging/vt6656/rxtx.h
+++ b/drivers/staging/vt6656/rxtx.h
@@ -179,11 +179,6 @@ struct vnt_tx_short_buf_head {
 	__le16 time_stamp_off;
 } __packed;
 
-struct vnt_beacon_buffer {
-	struct vnt_tx_usb_header usb;
-	struct vnt_tx_short_buf_head short_head;
-} __packed;
-
 int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb);
 int vnt_beacon_make(struct vnt_private *priv, struct ieee80211_vif *vif);
 int vnt_beacon_enable(struct vnt_private *priv, struct ieee80211_vif *vif,
-- 
2.27.0.rc0
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: vt6656: Fix vnt_tx_usb_header static checker warning
  2020-05-23 23:12 [PATCH] staging: vt6656: Fix vnt_tx_usb_header static checker warning Malcolm Priestley
@ 2020-05-26 13:50 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2020-05-26 13:50 UTC (permalink / raw)
  To: Malcolm Priestley; +Cc: devel, Greg Kroah-Hartman, linux-wireless

On Sun, May 24, 2020 at 12:12:41AM +0100, Malcolm Priestley wrote:
> drivers/staging/vt6656/rxtx.c:729 vnt_beacon_xmit()
> warn: struct type mismatch 'vnt_beacon_buffer vs vnt_tx_usb_header'
> 
> Since the only part of vnt_beacon_buffer is used remove and
> replace it with vnt_tx_usb_header.
> 
> Fixes: 9deca1e3e2b6 ("staging: vt6656: vnt_beacon_xmit use extra_tx_headroom.")

It's not really a bug fix.  It's just a cleanup.  But whatever...

> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks!

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-26 13:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-23 23:12 [PATCH] staging: vt6656: Fix vnt_tx_usb_header static checker warning Malcolm Priestley
2020-05-26 13:50 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).