[PATCH 28/28] staging: wilc1000: change data type of variable

Tony Cho tony.cho at atmel.com
Fri Jul 31 07:38:36 UTC 2015


From: glen lee <glen.lee at atmel.com>

drvHandler of u32 type is used to handle integer type pointer operation which
cause build warnings.
To use integer type varialbe as pointer, drvHandler data type need to be changed
with uintptr_t type.

drivers/staging/wilc1000/host_interface.c: In function ‘NetworkInfoReceived’:
drivers/staging/wilc1000/host_interface.c:6767:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
               ^
drivers/staging/wilc1000/host_interface.c: In function ‘GnrlAsyncInfoReceived’:
drivers/staging/wilc1000/host_interface.c:6819:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
               ^
drivers/staging/wilc1000/host_interface.c: In function ‘host_int_ScanCompleteReceived’:
drivers/staging/wilc1000/host_interface.c:6878:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;

Signed-off-by: glen lee <glen.lee at atmel.com>
Signed-off-by: Tony Cho <tony.cho at atmel.com>
---
 drivers/staging/wilc1000/host_interface.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index b36f98c..668e47e 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -6760,7 +6760,7 @@ void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length)
 {
 	s32 s32Error = WILC_SUCCESS;
 	tstrHostIFmsg strHostIFmsg;
-	u32 drvHandler;
+	uintptr_t drvHandler;
 	tstrWILC_WFIDrv *pstrWFIDrv = NULL;
 
 	drvHandler = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
@@ -6809,7 +6809,7 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length)
 {
 	s32 s32Error = WILC_SUCCESS;
 	tstrHostIFmsg strHostIFmsg;
-	u32 drvHandler;
+	uintptr_t drvHandler;
 	tstrWILC_WFIDrv *pstrWFIDrv = NULL;
 
 	/*BugID_5348*/
@@ -6871,7 +6871,7 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length)
 {
 	s32 s32Error = WILC_SUCCESS;
 	tstrHostIFmsg strHostIFmsg;
-	u32 drvHandler;
+	uintptr_t drvHandler;
 	tstrWILC_WFIDrv *pstrWFIDrv = NULL;
 
 	drvHandler = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
-- 
1.9.1



More information about the devel mailing list