diff mbox

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

Message ID 1438328316-30197-29-git-send-email-tony.cho@atmel.com (mailing list archive)
State Not Applicable
Delegated to: Kalle Valo
Headers show

Commit Message

Tony Cho July 31, 2015, 7:38 a.m. UTC
From: glen lee <glen.lee@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@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/host_interface.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Greg KH July 31, 2015, 8:48 p.m. UTC | #1
On Fri, Jul 31, 2015 at 04:38:36PM +0900, Tony Cho wrote:
> From: glen lee <glen.lee@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@atmel.com>
> Signed-off-by: Tony Cho <tony.cho@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;

This isn't a valid kernel type, use "unsigned int *" if that is what you mean.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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