Blob Blame History Raw
From 01bb31de526265e51e21e3efcdcbbe7e6906b051 Mon Sep 17 00:00:00 2001
From: Larry Finger <Larry.Finger@lwfinger.net>
Date: Mon, 12 Aug 2019 14:27:41 -0500
Subject: [PATCH] rtlwifi: rtl8192cu: Fix value set in descriptor
Git-commit: 01bb31de526265e51e21e3efcdcbbe7e6906b051
Patch-mainline: v5.4-rc1
References: bsc#1142635

In the process of converting the bit manipulation macros were converted
to use GENMASK(), the compiler reported a value too big for the field.
The offending statement was trying to write 0x100 into a 5-bit field.
An accompaning comment says to set bit 3, thus the code is changed
appropriately.

This error has been in the driver since its initial submission.

Fixes: 29d00a3e46bb ("rtlwifi: rtl8192cu: Add routine trx")
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
@@ -634,7 +634,7 @@ void rtl92cu_fill_fake_txdesc(struct iee
 		SET_TX_DESC_NAV_USE_HDR(pDesc, 1);
 	} else {
 		SET_TX_DESC_HWSEQ_EN(pDesc, 1); /* Hw set sequence number */
-		SET_TX_DESC_PKT_ID(pDesc, 0x100); /* set bit3 to 1. */
+		SET_TX_DESC_PKT_ID(pDesc, BIT(3)); /* set bit3 to 1. */
 	}
 	SET_TX_DESC_USE_RATE(pDesc, 1); /* use data rate which is set by Sw */
 	SET_TX_DESC_OWN(pDesc, 1);