linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtl8192e: Fixing checkpatch errors and removing unused defines
@ 2013-12-20 10:29 Andreas Frembs
  2013-12-20 10:29 ` [PATCH 1/3] rtl8192e: Fixing checkpatch errors Andreas Frembs
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andreas Frembs @ 2013-12-20 10:29 UTC (permalink / raw)
  To: andreas.frembs
  Cc: matthias.schoepe, gregkh, devel, linux-kernel, linux-kernel

We fixed checkpatch errors in the rtl8192e driver and noticed that some
macros that produced errors in checkpatch are unused, so we removed them.
There are no functional changes in this patch.


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

* [PATCH 1/3] rtl8192e: Fixing checkpatch errors
  2013-12-20 10:29 [PATCH] rtl8192e: Fixing checkpatch errors and removing unused defines Andreas Frembs
@ 2013-12-20 10:29 ` Andreas Frembs
  2013-12-20 10:29 ` [PATCH 2/3] rtl8192e: Removing unused defines in rtl819x_Qos.h Andreas Frembs
  2013-12-20 10:29 ` [PATCH 3/3] rlt8192e: Removing unused defines in rltlib_endianfree.h Andreas Frembs
  2 siblings, 0 replies; 4+ messages in thread
From: Andreas Frembs @ 2013-12-20 10:29 UTC (permalink / raw)
  To: andreas.frembs
  Cc: matthias.schoepe, gregkh, devel, linux-kernel, linux-kernel

This patch fixes the following checkpatch errors from rtllib_endianfree.h:
 - ERROR: Macros with complex values should be enclosed in parenthesis

Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>
---
 drivers/staging/rtl8192e/rtllib_endianfree.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_endianfree.h b/drivers/staging/rtl8192e/rtllib_endianfree.h
index b268605..39b8204 100644
--- a/drivers/staging/rtl8192e/rtllib_endianfree.h
+++ b/drivers/staging/rtl8192e/rtllib_endianfree.h
@@ -33,9 +33,9 @@
 #define ReadEF2Byte(_ptr)		EF2Byte(*((u16 *)(_ptr)))
 #define ReadEF4Byte(_ptr)		EF4Byte(*((u32 *)(_ptr)))
 
-#define WriteEF1Byte(_ptr, _val)	(*((u8 *)(_ptr))) = EF1Byte(_val)
-#define WriteEF2Byte(_ptr, _val)	(*((u16 *)(_ptr))) = EF2Byte(_val)
-#define WriteEF4Byte(_ptr, _val)	(*((u32 *)(_ptr))) = EF4Byte(_val)
+#define WriteEF1Byte(_ptr, _val)	((*((u8 *)(_ptr))) = EF1Byte(_val))
+#define WriteEF2Byte(_ptr, _val)	((*((u16 *)(_ptr))) = EF2Byte(_val))
+#define WriteEF4Byte(_ptr, _val)	((*((u32 *)(_ptr))) = EF4Byte(_val))
 #if BYTE_ORDER == __MACHINE_LITTLE_ENDIAN
 #define H2N1BYTE(_val)	((u8)(_val))
 #define H2N2BYTE(_val)	(((((u16)(_val))&0x00ff)<<8)|\
-- 
1.8.1.2


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

* [PATCH 2/3] rtl8192e: Removing unused defines in rtl819x_Qos.h
  2013-12-20 10:29 [PATCH] rtl8192e: Fixing checkpatch errors and removing unused defines Andreas Frembs
  2013-12-20 10:29 ` [PATCH 1/3] rtl8192e: Fixing checkpatch errors Andreas Frembs
@ 2013-12-20 10:29 ` Andreas Frembs
  2013-12-20 10:29 ` [PATCH 3/3] rlt8192e: Removing unused defines in rltlib_endianfree.h Andreas Frembs
  2 siblings, 0 replies; 4+ messages in thread
From: Andreas Frembs @ 2013-12-20 10:29 UTC (permalink / raw)
  To: andreas.frembs
  Cc: matthias.schoepe, gregkh, devel, linux-kernel, linux-kernel

In rtl819x_Qos.h there were several macros defined but never used.
So we removed this macros.

Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>

---
 drivers/staging/rtl8192e/rtl819x_Qos.h | 37 ----------------------------------
 1 file changed, 37 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h b/drivers/staging/rtl8192e/rtl819x_Qos.h
index 5ecd556..973342b 100644
--- a/drivers/staging/rtl8192e/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192e/rtl819x_Qos.h
@@ -201,43 +201,6 @@ enum qos_ie_source {
 
 #define AC_PARAM_SIZE	4
 
-#define GET_WMM_AC_PARAM_AIFSN(_pStart) \
-	((u8)LE_BITS_TO_4BYTE(_pStart, 0, 4))
-#define SET_WMM_AC_PARAM_AIFSN(_pStart, _val) \
-	SET_BITS_TO_LE_4BYTE(_pStart, 0, 4, _val)
-
-#define GET_WMM_AC_PARAM_ACM(_pStart) \
-	((u8)LE_BITS_TO_4BYTE(_pStart, 4, 1))
-#define SET_WMM_AC_PARAM_ACM(_pStart, _val) \
-	SET_BITS_TO_LE_4BYTE(_pStart, 4, 1, _val)
-
-#define GET_WMM_AC_PARAM_ACI(_pStart) \
-	((u8)LE_BITS_TO_4BYTE(_pStart, 5, 2))
-#define SET_WMM_AC_PARAM_ACI(_pStart, _val) \
-	SET_BITS_TO_LE_4BYTE(_pStart, 5, 2, _val)
-
-#define GET_WMM_AC_PARAM_ACI_AIFSN(_pStart) \
-	((u8)LE_BITS_TO_4BYTE(_pStart, 0, 8))
-#define SET_WMM_AC_PARAM_ACI_AIFSN(_pStart, _val) \
-	SET_BITS_TO_LE_4BYTE(_pStart, 0, 8, _val)
-
-#define GET_WMM_AC_PARAM_ECWMIN(_pStart) \
-	((u8)LE_BITS_TO_4BYTE(_pStart, 8, 4))
-#define SET_WMM_AC_PARAM_ECWMIN(_pStart, _val) \
-	SET_BITS_TO_LE_4BYTE(_pStart, 8, 4, _val)
-
-#define GET_WMM_AC_PARAM_ECWMAX(_pStart) \
-	((u8)LE_BITS_TO_4BYTE(_pStart, 12, 4))
-#define SET_WMM_AC_PARAM_ECWMAX(_pStart, _val) \
-	SET_BITS_TO_LE_4BYTE(_pStart, 12, 4, _val)
-
-#define GET_WMM_AC_PARAM_TXOP_LIMIT(_pStart) \
-	((u8)LE_BITS_TO_4BYTE(_pStart, 16, 16))
-#define SET_WMM_AC_PARAM_TXOP_LIMIT(_pStart, _val) \
-	SET_BITS_TO_LE_4BYTE(_pStart, 16, 16, _val)
-
-
-
 #define WMM_PARAM_ELEMENT_SIZE	(8+(4*AC_PARAM_SIZE))
 
 enum qos_ele_subtype {
-- 
1.8.1.2


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

* [PATCH 3/3] rlt8192e: Removing unused defines in rltlib_endianfree.h
  2013-12-20 10:29 [PATCH] rtl8192e: Fixing checkpatch errors and removing unused defines Andreas Frembs
  2013-12-20 10:29 ` [PATCH 1/3] rtl8192e: Fixing checkpatch errors Andreas Frembs
  2013-12-20 10:29 ` [PATCH 2/3] rtl8192e: Removing unused defines in rtl819x_Qos.h Andreas Frembs
@ 2013-12-20 10:29 ` Andreas Frembs
  2 siblings, 0 replies; 4+ messages in thread
From: Andreas Frembs @ 2013-12-20 10:29 UTC (permalink / raw)
  To: andreas.frembs
  Cc: matthias.schoepe, gregkh, devel, linux-kernel, linux-kernel

Checkpatch mentioned that these macros should be defined with a 'do {...} while(0)' statement.
So we used grep to find all files using these macros and we found out that these macros were only used 
in rtl819x_Qos.h, in the defines we removed before.
Since the macros are not used anywhere else we decided to remove them from the driver.

Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>

---
 drivers/staging/rtl8192e/rtllib_endianfree.h | 38 ----------------------------
 1 file changed, 38 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_endianfree.h b/drivers/staging/rtl8192e/rtllib_endianfree.h
index 39b8204..b189fa5 100644
--- a/drivers/staging/rtl8192e/rtllib_endianfree.h
+++ b/drivers/staging/rtl8192e/rtllib_endianfree.h
@@ -84,15 +84,6 @@
 	  (~BIT_OFFSET_LEN_MASK_32(__BitOffset, __BitLen)) \
 	)
 
-#define SET_BITS_TO_LE_4BYTE(__pStart, __BitOffset, __BitLen, __Value) \
-	*((u32 *)(__pStart)) = \
-	EF4Byte( \
-	LE_BITS_CLEARED_TO_4BYTE(__pStart, __BitOffset, __BitLen) \
-	| \
-	((((u32)__Value) & BIT_LEN_MASK_32(__BitLen)) << (__BitOffset)) \
-	);
-
-
 #define BIT_LEN_MASK_16(__BitLen) \
 	(0xFFFF >> (16 - (__BitLen)))
 
@@ -109,21 +100,6 @@
 	  BIT_LEN_MASK_16(__BitLen) \
 	)
 
-#define LE_BITS_CLEARED_TO_2BYTE(__pStart, __BitOffset, __BitLen) \
-	( \
-	  LE_P2BYTE_TO_HOST_2BYTE(__pStart) \
-	  & \
-	  (~BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen)) \
-	)
-
-#define SET_BITS_TO_LE_2BYTE(__pStart, __BitOffset, __BitLen, __Value) \
-	*((u16 *)(__pStart)) = \
-	EF2Byte( \
-		LE_BITS_CLEARED_TO_2BYTE(__pStart, __BitOffset, __BitLen) \
-		| ((((u16)__Value) & BIT_LEN_MASK_16(__BitLen)) <<	\
-		(__BitOffset)) \
-	);
-
 #define BIT_LEN_MASK_8(__BitLen) \
 	(0xFF >> (8 - (__BitLen)))
 
@@ -140,20 +116,6 @@
 	  BIT_LEN_MASK_8(__BitLen) \
 	)
 
-#define LE_BITS_CLEARED_TO_1BYTE(__pStart, __BitOffset, __BitLen) \
-	( \
-	  LE_P1BYTE_TO_HOST_1BYTE(__pStart) \
-	  & \
-	  (~BIT_OFFSET_LEN_MASK_8(__BitOffset, __BitLen)) \
-	)
-
-#define SET_BITS_TO_LE_1BYTE(__pStart, __BitOffset, __BitLen, __Value)	\
-	*((u8 *)(__pStart)) = EF1Byte(					\
-		LE_BITS_CLEARED_TO_1BYTE(__pStart, __BitOffset, __BitLen) \
-		| ((((u8)__Value) & BIT_LEN_MASK_8(__BitLen)) <<	\
-		(__BitOffset))						\
-	);
-
 #define	N_BYTE_ALIGMENT(__Value, __Aligment)			\
 	 ((__Aligment == 1) ? (__Value) : (((__Value + __Aligment - 1) / \
 	__Aligment) * __Aligment))
-- 
1.8.1.2


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

end of thread, other threads:[~2013-12-20 10:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-20 10:29 [PATCH] rtl8192e: Fixing checkpatch errors and removing unused defines Andreas Frembs
2013-12-20 10:29 ` [PATCH 1/3] rtl8192e: Fixing checkpatch errors Andreas Frembs
2013-12-20 10:29 ` [PATCH 2/3] rtl8192e: Removing unused defines in rtl819x_Qos.h Andreas Frembs
2013-12-20 10:29 ` [PATCH 3/3] rlt8192e: Removing unused defines in rltlib_endianfree.h Andreas Frembs

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).