[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220315205041.2714168-7-martin@kaiser.cx>
Date: Tue, 15 Mar 2022 21:50:41 +0100
From: Martin Kaiser <martin@...ser.cx>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Larry Finger <Larry.Finger@...inger.net>,
Phillip Potter <phil@...lpotter.co.uk>,
Michael Straube <straube.linux@...il.com>,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
Martin Kaiser <martin@...ser.cx>
Subject: [PATCH v2 6/6] staging: r8188eu: remove local BIT macro
The r8188eu driver defines a local BIT(x) macro. Remove this local macro
and use the one from include/linux/bits.h.
The global BIT macro returns an unsigned long value. Therefore, we have to
cast DYNAMIC_BB_DYNAMIC_TXPWR to u32 explicitly. This define is used with
the bitwise not operator.
Signed-off-by: Martin Kaiser <martin@...ser.cx>
---
v2:
- cast DYNAMIC_BB_DYNAMIC_TXPWR to u32, fix build error on 64-bit systems
drivers/staging/r8188eu/include/rtw_mlme_ext.h | 2 +-
drivers/staging/r8188eu/include/wifi.h | 7 +------
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/r8188eu/include/rtw_mlme_ext.h b/drivers/staging/r8188eu/include/rtw_mlme_ext.h
index 0c555ea6719b..2b5089be5156 100644
--- a/drivers/staging/r8188eu/include/rtw_mlme_ext.h
+++ b/drivers/staging/r8188eu/include/rtw_mlme_ext.h
@@ -34,7 +34,7 @@
/* BB ODM section BIT 0-15 */
#define DYNAMIC_BB_DIG BIT(0)
#define DYNAMIC_BB_RA_MASK BIT(1)
-#define DYNAMIC_BB_DYNAMIC_TXPWR BIT(2)
+#define DYNAMIC_BB_DYNAMIC_TXPWR ((u32)BIT(2))
#define DYNAMIC_BB_BB_FA_CNT BIT(3)
#define DYNAMIC_BB_RSSI_MONITOR BIT(4)
diff --git a/drivers/staging/r8188eu/include/wifi.h b/drivers/staging/r8188eu/include/wifi.h
index c331be19ff83..299553351246 100644
--- a/drivers/staging/r8188eu/include/wifi.h
+++ b/drivers/staging/r8188eu/include/wifi.h
@@ -4,14 +4,9 @@
#ifndef _WIFI_H_
#define _WIFI_H_
+#include <linux/bits.h>
#include <linux/ieee80211.h>
-#ifdef BIT
-/* error "BIT define occurred earlier elsewhere!\n" */
-#undef BIT
-#endif
-#define BIT(x) (1 << (x))
-
#define WLAN_ETHHDR_LEN 14
#define WLAN_HDR_A3_LEN 24
#define WLAN_HDR_A3_QOS_LEN 26
--
2.30.2
Powered by blists - more mailing lists