* [PATCH v2] staging: wilc1000: Remove pointer and integer comparision
@ 2015-08-09 15:35 Chandra S Gorentla
2015-08-10 4:30 ` Sudip Mukherjee
0 siblings, 1 reply; 2+ messages in thread
From: Chandra S Gorentla @ 2015-08-09 15:35 UTC (permalink / raw)
To: gregkh
Cc: johnny.kim, rachel.kim, dean.lee, chris.park, linux-wireless,
devel, linux-kernel, 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
Signed-off-by: Chandra S Gorentla <csgorentla@gmail.com>
---
Changes in v2: Subject line corrected wilc100 -> wilc1000
drivers/staging/wilc1000/host_interface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index cc549c2..4ba1ad7 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -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;
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] staging: wilc1000: Remove pointer and integer comparision
2015-08-09 15:35 [PATCH v2] staging: wilc1000: Remove pointer and integer comparision Chandra S Gorentla
@ 2015-08-10 4:30 ` Sudip Mukherjee
0 siblings, 0 replies; 2+ messages in thread
From: Sudip Mukherjee @ 2015-08-10 4:30 UTC (permalink / raw)
To: Chandra S Gorentla
Cc: gregkh, rachel.kim, dean.lee, chris.park, devel, linux-wireless,
johnny.kim, linux-kernel
On Sun, Aug 09, 2015 at 09:05:11PM +0530, Chandra S Gorentla wrote:
> 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
>
> Signed-off-by: Chandra S Gorentla <csgorentla@gmail.com>
> ---
> Changes in v2: Subject line corrected wilc100 -> wilc1000
>
> drivers/staging/wilc1000/host_interface.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index cc549c2..4ba1ad7 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-10 4:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-09 15:35 [PATCH v2] staging: wilc1000: Remove pointer and integer comparision Chandra S Gorentla
2015-08-10 4:30 ` Sudip Mukherjee
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).