staging, rtl8192e, LLVMLinux: Patches to enable the kernel to be compiled with clang/LLVM
cover staging, rtl8192e, LLVMLinux: Patches to enable the kernel to be compiled with clang/LLVM
Removing a number of warnings generated from compiling stl8192e with clang.
The LLVMLinux project aims to fully build the Linux kernel using both gcc and clang (the C front end for the LLVM compiler infrastructure project).
Behan Webster (4):
staging, rtl8192e, LLVMLinux: Change extern inline to static inline staging, rtl8192e, LLVMLinux: Remove unused inline prototype staging, rtl8192e, LLVMLinux: Remove unused prototype staging, rtl8192e, LLVMLinux: Make static local in inline function
const
drivers/staging/rtl8192e/rtllib.h | 6 ++---- drivers/staging/rtl8192e/rtllib_softmac.c | 11 ++++++----- 2 files changed, 8 insertions(+), 9 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/4 staging, rtl8192e, LLVMLinux: Change extern inline to static inline
With compilers which follow the C99 standard (like modern versions of gcc and clang), "extern inline" does the opposite thing from older versions of gcc (emits code for an externally linkable version of the inline function).
"static inline" does the intended behavior in all cases instead.
--- drivers/staging/rtl8192e/rtllib.h | 4 ++-- drivers/staging/rtl8192e/rtllib_softmac.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192e/rtllib.h +2 -2
@@ -2944,12 +2944,12 @@ void rtllib_softmac_scan_syncro(struct rtllib_device *ieee, u8 is_mesh);extern const long rtllib_wlan_frequencies[]; -extern inline void rtllib_increment_scans (struct rtllib_device *ieee) +static inline void rtllib_increment_scans (struct rtllib_device *ieee) { ieee->scans++; } -extern inline int rtllib_get_scans (struct rtllib_device *ieee) +static inline int rtllib_get_scans (struct rtllib_device *ieee) {return ieee->scans; }
drivers/staging/rtl8192e/rtllib_softmac.c +1 -1
@@ -343,7 +343,7 @@ inline void softmac_ps_mgmt_xmit(struct sk_buff *skb, } } -inline struct sk_buff *rtllib_probe_req (struct rtllib_device *ieee) +static inline struct sk_buff *rtllib_probe_req (struct rtllib_device *ieee) {unsigned int len, rate_len;u8 *tag;
Signature · 1 line
1.9.1
PATCH 2/4 staging, rtl8192e, LLVMLinux: Remove unused inline prototype
In reply to Behan Websterrtllib_probe_req is defined as "static inline" in rtllib_softmac.c however it is declared differently as "extern inline" in rtllib_softmac.h. Since it isn't used outside of the scope of rtllib_softmac, it makes sense to remove the incorrect declaration.
--- drivers/staging/rtl8192e/rtllib.h | 1 - 1 file changed, 1 deletion(-)
drivers/staging/rtl8192e/rtllib.h +0 -1
@@ -2762,7 +2762,6 @@ extern void rtllib_stop_scan(struct rtllib_device *ieee);extern bool rtllib_act_scanning (struct rtllib_device *ieee,bool sync_scan);extern void rtllib_stop_scan_syncro (struct rtllib_device *ieee);extern void rtllib_start_scan_syncro (struct rtllib_device *ieee,u8 is_mesh); -extern inline struct sk_buff *rtllib_probe_req (struct rtllib_device *ieee);extern u8 MgntQuery_MgntFrameTxRate (struct rtllib_device *ieee);extern void rtllib_sta_ps_send_null_frame (struct rtllib_device *ieee,short pwr);
Signature · 1 line
1.9.1
PATCH 3/4 staging, rtl8192e, LLVMLinux: Remove unused prototype
In reply to Behan WebsterMgntQuery_MgntFrameTxRate is only used within rtllib_softmac.c, so it really should be static instead of extern.
Since it is currently extern a warning is generated because a different function of the same name is defined staticlly in ieee80211_softmac.c
Removing the incorrect extern declaration and defining the rtllib_softmac version of this routine static fixes the warning.
--- drivers/staging/rtl8192e/rtllib.h | 1 - drivers/staging/rtl8192e/rtllib_softmac.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8192e/rtllib.h +0 -1
@@ -2762,7 +2762,6 @@ extern void rtllib_stop_scan(struct rtllib_device *ieee);extern bool rtllib_act_scanning (struct rtllib_device *ieee,bool sync_scan);extern void rtllib_stop_scan_syncro (struct rtllib_device *ieee);extern void rtllib_start_scan_syncro (struct rtllib_device *ieee,u8 is_mesh); -extern u8 MgntQuery_MgntFrameTxRate (struct rtllib_device *ieee);extern void rtllib_sta_ps_send_null_frame (struct rtllib_device *ieee,short pwr);extern void rtllib_sta_wakeup (struct rtllib_device *ieee,short nl);
drivers/staging/rtl8192e/rtllib_softmac.c +1 -1
@@ -193,7 +193,7 @@ MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee)return QueryRate; } -u8 MgntQuery_MgntFrameTxRate (struct rtllib_device *ieee) +static u8 MgntQuery_MgntFrameTxRate (struct rtllib_device *ieee) {struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;u8 rate;
Signature · 1 line
1.9.1
PATCH 4/4 staging, rtl8192e, LLVMLinux: Make static local in inline function const
In reply to Behan Websterrtllib_association_req is a (large) inline function which defines 2 constant static arrays which aren't labelled as const. As a result clang complains with:
non-constant static local variable in inline function may be different in different files
[-Wstatic-local-in-inline]
static u8 AironetIeOui[] = {0x00, 0x01, 0x66};
^
The solution is making them "static const".
However doing so requires dropping const when being used with struct octet_string. However the value is used in a const fashion thereafter, so no harm done.
--- drivers/staging/rtl8192e/rtllib_softmac.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/staging/rtl8192e/rtllib_softmac.c +4 -3
@@ -1311,7 +1311,7 @@ inline struct sk_buff *rtllib_association_req(struct rtllib_network *beacon, }if (beacon->bCkipSupported) { -static u8 AironetIeOui[] = {0x00 ,0x01 ,0x66 }; +static const u8 AironetIeOui[] = {0x00 ,0x01 ,0x66 };u8 CcxAironetBuf[30 ];struct octet_string osCcxAironetIE;
@@ -1331,10 +1331,11 @@ inline struct sk_buff *rtllib_association_req(struct rtllib_network *beacon, }if (beacon->bCcxRmEnable) { -static u8 CcxRmCapBuf[] = {0x00 ,0x40 ,0x96 ,0x01 ,0x01 ,0x00 }; +static const u8 CcxRmCapBuf[] = {0x00 ,0x40 ,0x96 ,0x01 ,0x01 , +0x00 };struct octet_string osCcxRmCap; - osCcxRmCap.Octet = CcxRmCapBuf; + osCcxRmCap.Octet = (u8 *) CcxRmCapBuf; osCcxRmCap.Length =sizeof (CcxRmCapBuf); tag =skb_put (skb, ccxrm_ie_len); *tag++ =MFIE_TYPE_GENERIC ;
Signature · 1 line
1.9.1