2015-12-01 00:09:09

by Mario J. Rugiero

[permalink] [raw]
Subject: [PATCH 1/1] staging: cleanup: Fix incompatible type comparison in wilc1000/host_interface.c

This patch replaces an "if (ptr > 0)" comparison that seems to be a
confusing way to check for null by a simpler "if (ptr)" check.

Signed-off-by: Mario J. Rugiero <[email protected]>
---
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 d5b7725..0c87f6c 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2270,7 +2270,7 @@ static void Handle_AddBeacon(struct host_if_drv *hif_drv,
*pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 16) & 0xFF);
*pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 24) & 0xFF);

- if (pstrSetBeaconParam->tail > 0)
+ if (pstrSetBeaconParam->tail)
memcpy(pu8CurrByte, pstrSetBeaconParam->tail, pstrSetBeaconParam->tail_len);
pu8CurrByte += pstrSetBeaconParam->tail_len;

--
2.6.2



2015-12-03 08:20:48

by Glen Lee

[permalink] [raw]
Subject: Re: [PATCH 1/1] staging: cleanup: Fix incompatible type comparison in wilc1000/host_interface.c



On 2015년 12월 03일 00:12, Mario J. Rugiero wrote:
> OK. Since the maintainers are CC'd, I guess I should wait for a
> clarification about this?

Hi Mario,

The purpose of that is to check if tail is null or not. if it is not null, there is tail
to send, so copy to buff.

regards,
glen lee.

>
> El 02/12/15 a las 10:29, Dan Carpenter escribió:
>> Put v2 in the subject. Also the subsystem prefix is:
>>
>> [PATCH v3] staging: wilc1000: ...
>>
>> On Mon, Nov 30, 2015 at 09:09:04PM -0300, Mario J. Rugiero wrote:
>>> This patch replaces an "if (ptr > 0)" comparison that seems to be a
>>> confusing way to check for null by a simpler "if (ptr)" check.
>>>
>>> Signed-off-by: Mario J. Rugiero <[email protected]>
>>> ---
>> v2: Remove the != NULL because checkpatch complains.
>>
>>> 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 d5b7725..0c87f6c 100644
>>> --- a/drivers/staging/wilc1000/host_interface.c
>>> +++ b/drivers/staging/wilc1000/host_interface.c
>>> @@ -2270,7 +2270,7 @@ static void Handle_AddBeacon(struct
>>> host_if_drv *hif_drv,
>>> *pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 16) & 0xFF);
>>> *pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 24) & 0xFF);
>>> - if (pstrSetBeaconParam->tail > 0)
>>> + if (pstrSetBeaconParam->tail)
>> Probably the intention was to check if "pstrSetBeaconParam->tail_len
>> > 0"
>> but I'm not sure. The wilc1000 maintainers are very responsive though
>> so maybe they will know for sure.
>>
>> regards,
>> dan carpenter
>>
>>
>
> _______________________________________________
> devel mailing list
> [email protected]
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


2015-12-02 13:29:38

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 1/1] staging: cleanup: Fix incompatible type comparison in wilc1000/host_interface.c

Put v2 in the subject. Also the subsystem prefix is:

[PATCH v3] staging: wilc1000: ...

On Mon, Nov 30, 2015 at 09:09:04PM -0300, Mario J. Rugiero wrote:
> This patch replaces an "if (ptr > 0)" comparison that seems to be a
> confusing way to check for null by a simpler "if (ptr)" check.
>
> Signed-off-by: Mario J. Rugiero <[email protected]>
> ---
v2: Remove the != NULL because checkpatch complains.

> 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 d5b7725..0c87f6c 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -2270,7 +2270,7 @@ static void Handle_AddBeacon(struct host_if_drv *hif_drv,
> *pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 16) & 0xFF);
> *pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 24) & 0xFF);
>
> - if (pstrSetBeaconParam->tail > 0)
> + if (pstrSetBeaconParam->tail)

Probably the intention was to check if "pstrSetBeaconParam->tail_len > 0"
but I'm not sure. The wilc1000 maintainers are very responsive though
so maybe they will know for sure.

regards,
dan carpenter



2015-12-03 15:17:37

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 1/1] staging: cleanup: Fix incompatible type comparison in wilc1000/host_interface.c

On Thu, Dec 03, 2015 at 12:13:59PM -0300, Mario J. Rugiero wrote:
> Thank you. Then the patch itself should see no changes as of now, am
> I right?
> Should I submit a new one anyway to fix the subject line?

Yes, please.

regards,
dan carpenter


2015-12-03 15:21:25

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 1/1] staging: cleanup: Fix incompatible type comparison in wilc1000/host_interface.c

On Thu, Dec 03, 2015 at 12:18:34PM -0300, Mario J. Rugiero wrote:
> Would be v3, or remains v2 because of the lack of further changes
> afterwards?

Bump the version number.

regards,
dan carpenter


2015-12-03 15:18:38

by Mario J. Rugiero

[permalink] [raw]
Subject: Re: [PATCH 1/1] staging: cleanup: Fix incompatible type comparison in wilc1000/host_interface.c

Would be v3, or remains v2 because of the lack of further changes
afterwards?

Regards,
Mario.

El 03/12/15 a las 12:17, Dan Carpenter escribi?:
> On Thu, Dec 03, 2015 at 12:13:59PM -0300, Mario J. Rugiero wrote:
>> Thank you. Then the patch itself should see no changes as of now, am
>> I right?
>> Should I submit a new one anyway to fix the subject line?
> Yes, please.
>
> regards,
> dan carpenter
>


2015-12-02 15:13:01

by Mario J. Rugiero

[permalink] [raw]
Subject: Re: [PATCH 1/1] staging: cleanup: Fix incompatible type comparison in wilc1000/host_interface.c

OK. Since the maintainers are CC'd, I guess I should wait for a
clarification about this?

El 02/12/15 a las 10:29, Dan Carpenter escribi?:
> Put v2 in the subject. Also the subsystem prefix is:
>
> [PATCH v3] staging: wilc1000: ...
>
> On Mon, Nov 30, 2015 at 09:09:04PM -0300, Mario J. Rugiero wrote:
>> This patch replaces an "if (ptr > 0)" comparison that seems to be a
>> confusing way to check for null by a simpler "if (ptr)" check.
>>
>> Signed-off-by: Mario J. Rugiero <[email protected]>
>> ---
> v2: Remove the != NULL because checkpatch complains.
>
>> 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 d5b7725..0c87f6c 100644
>> --- a/drivers/staging/wilc1000/host_interface.c
>> +++ b/drivers/staging/wilc1000/host_interface.c
>> @@ -2270,7 +2270,7 @@ static void Handle_AddBeacon(struct host_if_drv *hif_drv,
>> *pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 16) & 0xFF);
>> *pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 24) & 0xFF);
>>
>> - if (pstrSetBeaconParam->tail > 0)
>> + if (pstrSetBeaconParam->tail)
> Probably the intention was to check if "pstrSetBeaconParam->tail_len > 0"
> but I'm not sure. The wilc1000 maintainers are very responsive though
> so maybe they will know for sure.
>
> regards,
> dan carpenter
>
>


2015-12-03 15:14:05

by Mario J. Rugiero

[permalink] [raw]
Subject: Re: [PATCH 1/1] staging: cleanup: Fix incompatible type comparison in wilc1000/host_interface.c

Thank you. Then the patch itself should see no changes as of now, am I
right?
Should I submit a new one anyway to fix the subject line?

Regards,
Mario.