staging: rtl8192e: replace comparison to NULL by boolean
PATCH 1/3 staging: rtl8192e: replace comparison to NULL by boolean
Replaced comparison to NULL by boolean expressions (here used boolean negations). This improves readability of code. Reported by checkpatch.
--- drivers/staging/rtl8192e/rtl819x_HTProc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8192e/rtl819x_HTProc.c +5 -5
@@ -276,7 +276,7 @@ void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap,struct rt_hi_throughput *pHT = ieee->pHTInfo;struct ht_capab_ele *pCapELE =NULL ; -if ((posHTCap ==NULL ) || (pHT ==NULL )) { +if ((!posHTCap) || (!pHT)) {netdev_warn (ieee->dev,"%s(): posHTCap and pHTInfo are null\n" , __func__);return ;
@@ -357,7 +357,7 @@ void HTConstructInfoElement(struct rtllib_device *ieee, u8 *posHTInfo,struct rt_hi_throughput *pHT = ieee->pHTInfo;struct ht_info_ele *pHTInfoEle = (struct ht_info_ele *)posHTInfo; -if ((posHTInfo ==NULL ) || (pHTInfoEle ==NULL )) { +if ((!posHTInfo) || (!pHTInfoEle)) {netdev_warn (ieee->dev,"%s(): posHTInfo and pHTInfoEle are null\n" , __func__);
@@ -397,7 +397,7 @@ void HTConstructInfoElement(struct rtllib_device *ieee, u8 *posHTInfo,void HTConstructRT2RTAggElement (struct rtllib_device *ieee,u8 *posRT2RTAgg,u8 *len) { -if (posRT2RTAgg ==NULL ) { +if (!posRT2RTAgg) {netdev_warn (ieee->dev,"%s(): posRT2RTAgg is null\n" , __func__);return ; }
@@ -420,7 +420,7 @@ static u8 HT_PickMCSRate(struct rtllib_device *ieee, u8 *pOperateMCS) {u8 i; -if (pOperateMCS ==NULL ) { +if (!pOperateMCS) {netdev_warn (ieee->dev,"%s(): pOperateMCS is null\n" , __func__);return false; }
@@ -453,7 +453,7 @@ u8 HTGetHighestMCSRate(struct rtllib_device *ieee, u8 *pMCSRateSet,u8 mcsRate =0 ;u8 availableMcsRate[16 ]; -if (pMCSRateSet ==NULL || pMCSFilter ==NULL ) { +if (!pMCSRateSet || !pMCSFilter) {netdev_warn (ieee->dev,"%s(): pMCSRateSet and pMCSFilter are null\n" , __func__);
Signature · 1 line
2.30.2
Quoted 14 lines · Mitali Borkar
Replaced comparison to NULL by boolean expressions (here used boolean negations). This improves readability of code. Reported by checkpatch.
Signed-off-by Mitali Borkar <[email protected]>--- drivers/staging/rtl8192e/rtl819x_HTProc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/staging/rtl8192e/rtl819x_HTProc.c +0
-0
drivers/staging/rtl8192e/rtl819x_HTProc.c void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap, · line 279
Quoted 5 lines
drivers/staging/rtl8192e/rtl819x_HTProc.c +1
-1@@ -276,7 +276,7 @@ void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap,struct rt_hi_throughput *pHT = ieee->pHTInfo;struct ht_capab_ele *pCapELE =NULL ; -if ((posHTCap ==NULL ) || (pHT ==NULL )) { +if ((!posHTCap) || (!pHT)) {
You can drop the parentheses. ! has higher precedenace than ||.
julia
Quoted 47 lines
drivers/staging/rtl8192e/rtl819x_HTProc.c +4
-5netdev_warn (ieee->dev,"%s(): posHTCap and pHTInfo are null\n" , __func__);return ;@@ -357,7 +357,7 @@ void HTConstructInfoElement(struct rtllib_device *ieee, u8 *posHTInfo,struct rt_hi_throughput *pHT = ieee->pHTInfo;struct ht_info_ele *pHTInfoEle = (struct ht_info_ele *)posHTInfo; -if ((posHTInfo ==NULL ) || (pHTInfoEle ==NULL )) { +if ((!posHTInfo) || (!pHTInfoEle)) {netdev_warn (ieee->dev,"%s(): posHTInfo and pHTInfoEle are null\n" , __func__);@@ -397,7 +397,7 @@ void HTConstructInfoElement(struct rtllib_device *ieee, u8 *posHTInfo,void HTConstructRT2RTAggElement (struct rtllib_device *ieee,u8 *posRT2RTAgg,u8 *len) { -if (posRT2RTAgg ==NULL ) { +if (!posRT2RTAgg) {netdev_warn (ieee->dev,"%s(): posRT2RTAgg is null\n" , __func__);return ; }@@ -420,7 +420,7 @@ static u8 HT_PickMCSRate(struct rtllib_device *ieee, u8 *pOperateMCS) {u8 i; -if (pOperateMCS ==NULL ) { +if (!pOperateMCS) {netdev_warn (ieee->dev,"%s(): pOperateMCS is null\n" , __func__);return false; }@@ -453,7 +453,7 @@ u8 HTGetHighestMCSRate(struct rtllib_device *ieee, u8 *pMCSRateSet,u8 mcsRate =0 ;u8 availableMcsRate[16 ]; -if (pMCSRateSet ==NULL || pMCSFilter ==NULL ) { +if (!pMCSRateSet || !pMCSFilter) {netdev_warn (ieee->dev,"%s(): pMCSRateSet and pMCSFilter are null\n" , __func__); --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/YHEJngq5MHBEspGY%40kali.