Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com>
Link: https://lore.kernel.org/r/20210430125657.18264-1-zhaoxiao@uniontech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

zhaoxiao and committed by
Greg Kroah-Hartman
84b45d4f 66d708e6

+5 -5
+5 -5
drivers/staging/rtl8192e/rtl819x_HTProc.c
··· 276 276 struct rt_hi_throughput *pHT = ieee->pHTInfo; 277 277 struct ht_capab_ele *pCapELE = NULL; 278 278 279 - if ((posHTCap == NULL) || (pHT == NULL)) { 279 + if (!posHTCap || !pHT) { 280 280 netdev_warn(ieee->dev, 281 281 "%s(): posHTCap and pHTInfo are null\n", __func__); 282 282 return; ··· 357 357 struct rt_hi_throughput *pHT = ieee->pHTInfo; 358 358 struct ht_info_ele *pHTInfoEle = (struct ht_info_ele *)posHTInfo; 359 359 360 - if ((posHTInfo == NULL) || (pHTInfoEle == NULL)) { 360 + if (!posHTInfo || !pHTInfoEle) { 361 361 netdev_warn(ieee->dev, 362 362 "%s(): posHTInfo and pHTInfoEle are null\n", 363 363 __func__); ··· 397 397 void HTConstructRT2RTAggElement(struct rtllib_device *ieee, u8 *posRT2RTAgg, 398 398 u8 *len) 399 399 { 400 - if (posRT2RTAgg == NULL) { 400 + if (!posRT2RTAgg) { 401 401 netdev_warn(ieee->dev, "%s(): posRT2RTAgg is null\n", __func__); 402 402 return; 403 403 } ··· 420 420 { 421 421 u8 i; 422 422 423 - if (pOperateMCS == NULL) { 423 + if (!pOperateMCS) { 424 424 netdev_warn(ieee->dev, "%s(): pOperateMCS is null\n", __func__); 425 425 return false; 426 426 } ··· 453 453 u8 mcsRate = 0; 454 454 u8 availableMcsRate[16]; 455 455 456 - if (pMCSRateSet == NULL || pMCSFilter == NULL) { 456 + if (!pMCSRateSet || !pMCSFilter) { 457 457 netdev_warn(ieee->dev, 458 458 "%s(): pMCSRateSet and pMCSFilter are null\n", 459 459 __func__);