diff options
author | Michael Straube <straube.linux@gmail.com> | 2020-09-19 10:50:31 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-22 09:49:59 +0200 |
commit | 0e934ce2904e05d80f79f7fcb08632df3d994b6b (patch) | |
tree | b35bbb111c6b0068b1df5a6ec7f4035ad6930688 /drivers/staging/rtl8712/rtl871x_ioctl_linux.c | |
parent | dbbc8fdf2ad57629436bcdb421c2d4ad9aa1974f (diff) | |
download | linux-0e934ce2904e05d80f79f7fcb08632df3d994b6b.tar.bz2 |
staging: rtl8712: clean up comparsions to NULL
Clean up comparsions to NULL Reported by checkpatch.
if (x == NULL) -> if (!x)
if (x != NULL) -> if (x)
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200919085032.32453-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712/rtl871x_ioctl_linux.c')
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c index df6ae855f3c1..cbaa7a489748 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c @@ -481,11 +481,11 @@ static int r871x_set_wpa_ie(struct _adapter *padapter, char *pie, int group_cipher = 0, pairwise_cipher = 0; int ret = 0; - if ((ielen > MAX_WPA_IE_LEN) || (pie == NULL)) + if (ielen > MAX_WPA_IE_LEN || !pie) return -EINVAL; if (ielen) { buf = kmemdup(pie, ielen, GFP_ATOMIC); - if (buf == NULL) + if (!buf) return -ENOMEM; if (ielen < RSN_HEADER_LEN) { ret = -EINVAL; @@ -777,7 +777,7 @@ static int r871x_wx_set_pmkid(struct net_device *dev, * If cmd is IW_PMKSA_REMOVE, it means the wpa_supplicant wants to * remove a PMKID/BSSID from driver. */ - if (pPMK == NULL) + if (!pPMK) return -EINVAL; memcpy(strIssueBssid, pPMK->bssid.sa_data, ETH_ALEN); switch (pPMK->cmd) { @@ -1099,7 +1099,7 @@ static int r871x_wx_set_mlme(struct net_device *dev, struct _adapter *padapter = netdev_priv(dev); struct iw_mlme *mlme = (struct iw_mlme *) extra; - if (mlme == NULL) + if (!mlme) return -1; switch (mlme->cmd) { case IW_MLME_DEAUTH: @@ -1950,7 +1950,7 @@ static int r871x_get_ap_info(struct net_device *dev, u8 bssid[ETH_ALEN]; char data[33]; - if (padapter->driver_stopped || (pdata == NULL)) + if (padapter->driver_stopped || !pdata) return -EINVAL; while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING)) { @@ -2014,7 +2014,7 @@ static int r871x_set_pid(struct net_device *dev, struct _adapter *padapter = netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - if ((padapter->driver_stopped) || (pdata == NULL)) + if (padapter->driver_stopped || !pdata) return -EINVAL; if (copy_from_user(&padapter->pid, pdata->pointer, sizeof(int))) return -EINVAL; @@ -2030,7 +2030,7 @@ static int r871x_set_chplan(struct net_device *dev, struct iw_point *pdata = &wrqu->data; int ch_plan = -1; - if ((padapter->driver_stopped) || (pdata == NULL)) { + if (padapter->driver_stopped || !pdata) { ret = -EINVAL; goto exit; } @@ -2050,7 +2050,7 @@ static int r871x_wps_start(struct net_device *dev, struct iw_point *pdata = &wrqu->data; u32 u32wps_start = 0; - if ((padapter->driver_stopped) || (pdata == NULL)) + if (padapter->driver_stopped || !pdata) return -EINVAL; if (copy_from_user((void *)&u32wps_start, pdata->pointer, 4)) return -EFAULT; |