staging: rtl8192e: replace comparison to NULL by bool
PATCH 1/1 staging: rtl8192e: replace comparison to NULL by bool
Fixed Comparison to NULL can be written as '!...' by replacing it with simpler form i.e boolean expression. This makes code more readable alternative. Reported by checkpatch.
--- drivers/staging/rtl8192e/rtl819x_TSProc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192e/rtl819x_TSProc.c +3 -3
@@ -269,12 +269,12 @@ static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *Addr, {u8 count; -if (pTsCommonInfo ==NULL ) +if (!pTsCommonInfo)return ;memcpy (pTsCommonInfo->Addr, Addr,6 ); -if (pTSPEC !=NULL ) +if (pTSPEC)memcpy ((u8 *)(&(pTsCommonInfo->TSpec)), (u8 *)pTSPEC,sizeof (union tspec_body ));
@@ -328,7 +328,7 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, } *ppTS =SearchAdmitTRStream (ieee, Addr,UP , TxRxSelect); -if (*ppTS !=NULL ) +if (ppTS)return true;if (!bAddNewTs) {
Signature · 1 line
2.30.2
Quoted 29 lines · Mitali Borkar
Fixed Comparison to NULL can be written as '!...' by replacing it with simpler form i.e boolean expression. This makes code more readable alternative. Reported by checkpatch.
Signed-off-by Mitali Borkar <[email protected]>--- drivers/staging/rtl8192e/rtl819x_TSProc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/staging/rtl8192e/rtl819x_TSProc.c +2
-2@@ -269,12 +269,12 @@ static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *Addr, {u8 count; -if (pTsCommonInfo ==NULL ) +if (!pTsCommonInfo)return ;memcpy (pTsCommonInfo->Addr, Addr,6 ); -if (pTSPEC !=NULL ) +if (pTSPEC)memcpy ((u8 *)(&(pTsCommonInfo->TSpec)), (u8 *)pTSPEC,sizeof (union tspec_body ));
drivers/staging/rtl8192e/rtl819x_TSProc.c bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, · line 331
Quoted 5 lines
drivers/staging/rtl8192e/rtl819x_TSProc.c +1
-1@@ -328,7 +328,7 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, } *ppTS =SearchAdmitTRStream (ieee, Addr,UP , TxRxSelect); -if (*ppTS !=NULL ) +if (ppTS)
You lost a * here.
julia
Quoted 11 lines
drivers/staging/rtl8192e/rtl819x_TSProc.c +0
-1return true;if (!bAddNewTs) { --2.30.2
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/YHDnWpWztxeZospi%40kali.
Greg KH
maintainerQuoted 32 lines · Julia Lawall
Quoted 28 lines · Mitali Borkar
Fixed Comparison to NULL can be written as '!...' by replacing it with simpler form i.e boolean expression. This makes code more readable alternative. Reported by checkpatch.
Signed-off-by Mitali Borkar <[email protected]>--- drivers/staging/rtl8192e/rtl819x_TSProc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/staging/rtl8192e/rtl819x_TSProc.c +2
-2@@ -269,12 +269,12 @@ static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *Addr, {u8 count; -if (pTsCommonInfo ==NULL ) +if (!pTsCommonInfo)return ;memcpy (pTsCommonInfo->Addr, Addr,6 ); -if (pTSPEC !=NULL ) +if (pTSPEC)memcpy ((u8 *)(&(pTsCommonInfo->TSpec)), (u8 *)pTSPEC,sizeof (union tspec_body ));
Quoted 8 lines
drivers/staging/rtl8192e/rtl819x_TSProc.c bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, · line 331
Quoted 6 lines
drivers/staging/rtl8192e/rtl819x_TSProc.c +1
-1@@ -328,7 +328,7 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, } *ppTS =SearchAdmitTRStream (ieee, Addr,UP , TxRxSelect); -if (*ppTS !=NULL ) +if (ppTS)You lost a * here.
Ugh, good catch.
Mitali, can you send me a fix-up patch for this, or do you want me to drop your original patch from my tree?
thanks,
greg k-h
Quoted 42 lines · Greg KH
Quoted 32 lines · Julia Lawall
Quoted 28 lines · Mitali Borkar
Fixed Comparison to NULL can be written as '!...' by replacing it with simpler form i.e boolean expression. This makes code more readable alternative. Reported by checkpatch.
Signed-off-by Mitali Borkar <[email protected]>--- drivers/staging/rtl8192e/rtl819x_TSProc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/staging/rtl8192e/rtl819x_TSProc.c +2
-2@@ -269,12 +269,12 @@ static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *Addr, {u8 count; -if (pTsCommonInfo ==NULL ) +if (!pTsCommonInfo)return ;memcpy (pTsCommonInfo->Addr, Addr,6 ); -if (pTSPEC !=NULL ) +if (pTSPEC)memcpy ((u8 *)(&(pTsCommonInfo->TSpec)), (u8 *)pTSPEC,sizeof (union tspec_body ));Quoted 8 lines
drivers/staging/rtl8192e/rtl819x_TSProc.c bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, · line 331
Quoted 6 lines
drivers/staging/rtl8192e/rtl819x_TSProc.c +1
-1@@ -328,7 +328,7 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, } *ppTS =SearchAdmitTRStream (ieee, Addr,UP , TxRxSelect); -if (*ppTS !=NULL ) +if (ppTS)You lost a * here.
Quoted 5 lines
Ugh, good catch.
Mitali, can you send me a fix-up patch for this, or do you want me to drop your original patch from my tree?
Yes Sir, I am making corrections right now in this patch. Will send the fix up patch in an hour.
Quoted 3 lines
thanks,
greg k-h