mirror of https://gitee.com/openkylin/linux.git
staging: rtl8192u: Replace explicit NULL comparisons with !
This patch replace explicit NULL comparison with ! or unmark operator to simplify code. Reported by checkpatch.pl for comparison to NULL could be written "!XXX" or "XXX". Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
faa86645e9
commit
f8f65f2ba7
|
@ -80,7 +80,7 @@ void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee,
|
||||||
struct ieee80211_crypt_data *tmp;
|
struct ieee80211_crypt_data *tmp;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
if (*crypt == NULL)
|
if (!(*crypt))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
tmp = *crypt;
|
tmp = *crypt;
|
||||||
|
@ -105,11 +105,11 @@ int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops)
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
struct ieee80211_crypto_alg *alg;
|
struct ieee80211_crypto_alg *alg;
|
||||||
|
|
||||||
if (hcrypt == NULL)
|
if (!hcrypt)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
alg = kzalloc(sizeof(*alg), GFP_KERNEL);
|
alg = kzalloc(sizeof(*alg), GFP_KERNEL);
|
||||||
if (alg == NULL)
|
if (!alg)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
alg->ops = ops;
|
alg->ops = ops;
|
||||||
|
@ -130,7 +130,7 @@ int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops)
|
||||||
struct list_head *ptr;
|
struct list_head *ptr;
|
||||||
struct ieee80211_crypto_alg *del_alg = NULL;
|
struct ieee80211_crypto_alg *del_alg = NULL;
|
||||||
|
|
||||||
if (hcrypt == NULL)
|
if (!hcrypt)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
spin_lock_irqsave(&hcrypt->lock, flags);
|
spin_lock_irqsave(&hcrypt->lock, flags);
|
||||||
|
@ -161,7 +161,7 @@ struct ieee80211_crypto_ops *ieee80211_get_crypto_ops(const char *name)
|
||||||
struct list_head *ptr;
|
struct list_head *ptr;
|
||||||
struct ieee80211_crypto_alg *found_alg = NULL;
|
struct ieee80211_crypto_alg *found_alg = NULL;
|
||||||
|
|
||||||
if (hcrypt == NULL)
|
if (!hcrypt)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
spin_lock_irqsave(&hcrypt->lock, flags);
|
spin_lock_irqsave(&hcrypt->lock, flags);
|
||||||
|
@ -223,7 +223,7 @@ void __exit ieee80211_crypto_deinit(void)
|
||||||
{
|
{
|
||||||
struct list_head *ptr, *n;
|
struct list_head *ptr, *n;
|
||||||
|
|
||||||
if (hcrypt == NULL)
|
if (!hcrypt)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (ptr = hcrypt->algs.next, n = ptr->next; ptr != &hcrypt->algs;
|
for (ptr = hcrypt->algs.next, n = ptr->next; ptr != &hcrypt->algs;
|
||||||
|
|
Loading…
Reference in New Issue