Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1271629 > unrolled thread

[PATCH] drivers:staging:wilc1000 Fix comparison to NULL messages

Started byBogicevic Sasa <brutallesale@gmail.com>
First post2015-11-17 21:10 +0100
Last post2015-11-18 12:40 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] drivers:staging:wilc1000 Fix comparison to NULL messages Bogicevic Sasa <brutallesale@gmail.com> - 2015-11-17 21:10 +0100
    Re: [PATCH] drivers:staging:wilc1000 Fix comparison to NULL messages Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-11-18 07:20 +0100
      Re: [PATCH] drivers:staging:wilc1000 Fix comparison to NULL messages Bogicevic Sasa <brutallesale@gmail.com> - 2015-11-18 12:40 +0100

#1271629 — [PATCH] drivers:staging:wilc1000 Fix comparison to NULL messages

FromBogicevic Sasa <brutallesale@gmail.com>
Date2015-11-17 21:10 +0100
Subject[PATCH] drivers:staging:wilc1000 Fix comparison to NULL messages
Message-ID<qvUJH-1gq-1@gated-at.bofh.it>
This fixes all "Comparison to NULL could be written like..."
messages from checkpatch.pl

Signed-off-by: Bogicevic Sasa <brutallesale@gmail.com>
---
 drivers/staging/wilc1000/coreconfigurator.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index fd7240c..a31ac55 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -434,7 +434,7 @@ s32 parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
 
 		/* Get DTIM Period */
 		pu8TimElm = get_tim_elm(pu8msa, u16RxLen + FCS_LEN, u8index);
-		if (pu8TimElm != NULL)
+		if (!pu8TimElm)
 			pstrNetworkInfo->u8DtimPeriod = pu8TimElm[3];
 		pu8IEs = &pu8msa[MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN];
 		u16IEsLen = u16RxLen - (MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN);
@@ -468,8 +468,8 @@ s32 DeallocateNetworkInfo(tstrNetworkInfo *pstrNetworkInfo)
 {
 	s32 s32Error = 0;
 
-	if (pstrNetworkInfo != NULL) {
-		if (pstrNetworkInfo->pu8IEs != NULL) {
+	if (!pstrNetworkInfo) {
+		if (!pstrNetworkInfo->pu8IEs) {
 			kfree(pstrNetworkInfo->pu8IEs);
 			pstrNetworkInfo->pu8IEs = NULL;
 		} else {
@@ -553,8 +553,8 @@ s32 DeallocateAssocRespInfo(tstrConnectRespInfo *pstrConnectRespInfo)
 {
 	s32 s32Error = 0;
 
-	if (pstrConnectRespInfo != NULL) {
-		if (pstrConnectRespInfo->pu8RespIEs != NULL) {
+	if (!pstrConnectRespInfo) {
+		if (!pstrConnectRespInfo->pu8RespIEs) {
 			kfree(pstrConnectRespInfo->pu8RespIEs);
 			pstrConnectRespInfo->pu8RespIEs = NULL;
 		} else {
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1271862

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-11-18 07:20 +0100
Message-ID<qw4g2-7vR-17@gated-at.bofh.it>
In reply to#1271629
On Tue, Nov 17, 2015 at 09:01:28PM +0100, Bogicevic Sasa wrote:
> This fixes all "Comparison to NULL could be written like..."
> messages from checkpatch.pl
> 
> Signed-off-by: Bogicevic Sasa <brutallesale@gmail.com>
> ---
>  drivers/staging/wilc1000/coreconfigurator.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
> index fd7240c..a31ac55 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.c
> +++ b/drivers/staging/wilc1000/coreconfigurator.c
> @@ -434,7 +434,7 @@ s32 parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
>  
>  		/* Get DTIM Period */
>  		pu8TimElm = get_tim_elm(pu8msa, u16RxLen + FCS_LEN, u8index);
> -		if (pu8TimElm != NULL)
> +		if (!pu8TimElm)

You are now checking for -  if (pu8TimElm == NULL)	
It should actually be: if (pu8TimElm)

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1272108

FromBogicevic Sasa <brutallesale@gmail.com>
Date2015-11-18 12:40 +0100
Message-ID<qw9fH-2gd-21@gated-at.bofh.it>
In reply to#1271862
On 11/18, Sudip Mukherjee wrote:
>On Tue, Nov 17, 2015 at 09:01:28PM +0100, Bogicevic Sasa wrote:
>> This fixes all "Comparison to NULL could be written like..."
>> messages from checkpatch.pl
>>
>> Signed-off-by: Bogicevic Sasa <brutallesale@gmail.com>
>> ---
>>  drivers/staging/wilc1000/coreconfigurator.c | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
>> index fd7240c..a31ac55 100644
>> --- a/drivers/staging/wilc1000/coreconfigurator.c
>> +++ b/drivers/staging/wilc1000/coreconfigurator.c
>> @@ -434,7 +434,7 @@ s32 parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
>>
>>  		/* Get DTIM Period */
>>  		pu8TimElm = get_tim_elm(pu8msa, u16RxLen + FCS_LEN, u8index);
>> -		if (pu8TimElm != NULL)
>> +		if (!pu8TimElm)
>
>You are now checking for -  if (pu8TimElm == NULL)	
>It should actually be: if (pu8TimElm)
>
>regards
>sudip
Right, so stuped, Ill resend it
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web