Skip to contentSkip to conversation

staging: wilc1000: Remove pointer and integer comparision

PATCH In review Chandra S Gorentla 2 participants 2 messages Aug 9, 2015 – Aug 10, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: wilc1000: Remove pointer and integer comparision

Removed pointer check with integer; this fixes 'sparse' error -
error: incompatible types for operation (>)
left side has type unsigned char [usertype] *[usertype] pu8Tail right side has type int

---
Changes in v2: Subject line corrected wilc100 -> wilc1000

 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/host_interface.c +1 -1
index cc549c2..4ba1ad7 100644
@@ -3471,7 +3471,7 @@ static void Handle_AddBeacon(void *drvHandler, tstrHostIFSetBeacon *pstrSetBeaco
 	*pu8CurrByte++ = ((pstrSetBeaconParam->u32TailLen >> 24) & 0xFF);
 
 	/* Bug 4599 : if tail length = 0 skip copying */
-	if (pstrSetBeaconParam->pu8Tail > 0)
+	if (pstrSetBeaconParam->pu8Tail != NULL)
 		memcpy(pu8CurrByte, pstrSetBeaconParam->pu8Tail, pstrSetBeaconParam->u32TailLen);
 	pu8CurrByte += pstrSetBeaconParam->u32TailLen;
 
Signature · 1 line
2.5.0
#1 lore raw
Quoted 17 lines · Chandra S Gorentla

Removed pointer check with integer; this fixes 'sparse' error -
error: incompatible types for operation (>)
left side has type unsigned char [usertype] *[usertype] pu8Tail right side has type int

---
Changes in v2: Subject line corrected wilc100 -> wilc1000

 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/host_interface.c +0 -0
index cc549c2..4ba1ad7 100644

drivers/staging/wilc1000/host_interface.c static void Handle_AddBeacon(void *drvHandler, tstrHostIFSetBeacon *pstrSetBeaco · line 3474

Quoted 5 lines
drivers/staging/wilc1000/host_interface.c +1 -1
@@ -3471,7 +3471,7 @@ static void Handle_AddBeacon(void *drvHandler, tstrHostIFSetBeacon *pstrSetBeaco
 	*pu8CurrByte++ = ((pstrSetBeaconParam->u32TailLen >> 24) & 0xFF);
 
 	/* Bug 4599 : if tail length = 0 skip copying */
-	if (pstrSetBeaconParam->pu8Tail > 0)
+	if (pstrSetBeaconParam->pu8Tail != NULL)

This NULL test can be better wriiten as if (pstrSetBeaconParam->pu8Tail)

regards
sudip