From 366ba427032eaefdec9d3fd318f23eea2b26ead6 Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Mon, 6 Oct 2014 14:23:18 +0530 Subject: [PATCH] staging: rtl8712: Delete explicit comparison with false and NULL This patch delete explicit comparison to false and NULL in files of rtl8712. Signed-off-by: Tapasweni Pathak Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8712/recv_linux.c | 2 +- drivers/staging/rtl8712/rtl871x_io.c | 2 +- drivers/staging/rtl8712/rtl871x_ioctl_set.c | 20 +++++++++----------- drivers/staging/rtl8712/rtl871x_mp.c | 4 ++-- drivers/staging/rtl8712/usb_intf.c | 10 +++++----- drivers/staging/rtl8712/usb_ops_linux.c | 6 +++--- 6 files changed, 21 insertions(+), 23 deletions(-) diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c index 495ee1205e02..0631f3638257 100644 --- a/drivers/staging/rtl8712/recv_linux.c +++ b/drivers/staging/rtl8712/recv_linux.c @@ -146,7 +146,7 @@ void r8712_os_read_port(struct _adapter *padapter, struct recv_buf *precvbuf) dev_kfree_skb_any(precvbuf->pskb); precvbuf->pskb = NULL; precvbuf->reuse = false; - if (precvbuf->irp_pending == false) + if (!precvbuf->irp_pending) r8712_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); } diff --git a/drivers/staging/rtl8712/rtl871x_io.c b/drivers/staging/rtl8712/rtl871x_io.c index d7b63aedead7..3a0236606396 100644 --- a/drivers/staging/rtl8712/rtl871x_io.c +++ b/drivers/staging/rtl8712/rtl871x_io.c @@ -93,7 +93,7 @@ static uint register_intf_hdl(u8 *dev, struct intf_hdl *pintfhdl) pintfhdl->intf_option = 0; pintfhdl->adapter = dev; pintfhdl->intf_dev = (u8 *)&(adapter->dvobjpriv); - if (_init_intf_hdl(adapter, pintfhdl) == false) + if (!_init_intf_hdl(adapter, pintfhdl)) goto register_intf_hdl_fail; return _SUCCESS; register_intf_hdl_fail: diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_set.c b/drivers/staging/rtl8712/rtl871x_ioctl_set.c index 9d47eb472837..a240b6389683 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_set.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_set.c @@ -77,7 +77,7 @@ static u8 do_join(struct _adapter *padapter) /* when set_ssid/set_bssid for do_join(), but scanning queue * is empty we try to issue sitesurvey firstly */ - if (pmlmepriv->sitesurveyctrl.traffic_busy == false) + if (!pmlmepriv->sitesurveyctrl.traffic_busy) r8712_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid); return true; } else { @@ -143,8 +143,7 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid) _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) { if (!memcmp(&pmlmepriv->cur_network.network.MacAddress, bssid, ETH_ALEN)) { - if (check_fwstate(pmlmepriv, - WIFI_STATION_STATE) == false) + if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) goto _Abort_Set_BSSID; /* driver is in * WIFI_ADHOC_MASTER_STATE */ } else { @@ -177,7 +176,7 @@ void r8712_set_802_11_ssid(struct _adapter *padapter, struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wlan_network *pnetwork = &pmlmepriv->cur_network; - if (padapter->hw_init_completed == false) + if (!padapter->hw_init_completed) return; spin_lock_irqsave(&pmlmepriv->lock, irqL); if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING)) { @@ -188,10 +187,9 @@ void r8712_set_802_11_ssid(struct _adapter *padapter, if ((pmlmepriv->assoc_ssid.SsidLength == ssid->SsidLength) && (!memcmp(&pmlmepriv->assoc_ssid.Ssid, ssid->Ssid, ssid->SsidLength))) { - if ((check_fwstate(pmlmepriv, - WIFI_STATION_STATE) == false)) { - if (r8712_is_same_ibss(padapter, - pnetwork) == false) { + if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { + if (!r8712_is_same_ibss(padapter, + pnetwork)) { /* if in WIFI_ADHOC_MASTER_STATE or * WIFI_ADHOC_STATE, create bss or * rejoin again @@ -227,7 +225,7 @@ void r8712_set_802_11_ssid(struct _adapter *padapter, } if (padapter->securitypriv.btkip_countermeasure == true) goto _Abort_Set_SSID; - if (validate_ssid(ssid) == false) + if (!validate_ssid(ssid)) goto _Abort_Set_SSID; memcpy(&pmlmepriv->assoc_ssid, ssid, sizeof(struct ndis_802_11_ssid)); pmlmepriv->assoc_by_bssid = false; @@ -308,10 +306,10 @@ u8 r8712_set_802_11_bssid_list_scan(struct _adapter *padapter) unsigned long irqL; u8 ret = true; - if (padapter == NULL) + if (!padapter) return false; pmlmepriv = &padapter->mlmepriv; - if (padapter->hw_init_completed == false) + if (!padapter->hw_init_completed) return false; spin_lock_irqsave(&pmlmepriv->lock, irqL); if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING)) || diff --git a/drivers/staging/rtl8712/rtl871x_mp.c b/drivers/staging/rtl8712/rtl871x_mp.c index 2ec660ad78af..3d913b9701bb 100644 --- a/drivers/staging/rtl8712/rtl871x_mp.c +++ b/drivers/staging/rtl8712/rtl871x_mp.c @@ -56,7 +56,7 @@ static int init_mp_priv(struct mp_priv *pmp_priv) pmp_priv->pallocated_mp_xmitframe_buf = kmalloc(NR_MP_XMITFRAME * sizeof(struct mp_xmit_frame) + 4, GFP_ATOMIC); - if (pmp_priv->pallocated_mp_xmitframe_buf == NULL) { + if (!pmp_priv->pallocated_mp_xmitframe_buf) { res = _FAIL; goto _exit_init_mp_priv; } @@ -173,7 +173,7 @@ u8 r8712_bb_reg_write(struct _adapter *pAdapter, u16 offset, u32 value) oldValue = r8712_bb_reg_read(pAdapter, iocmd.value); oldValue &= (0xFFFFFFFF >> ((4 - shift) * 8)); value = oldValue | (newValue << (shift * 8)); - if (fw_iocmd_write(pAdapter, iocmd, value) == false) + if (!fw_iocmd_write(pAdapter, iocmd, value)) return false; iocmd.value += 4; oldValue = r8712_bb_reg_read(pAdapter, iocmd.value); diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c index a3d733b145eb..da3856dda728 100644 --- a/drivers/staging/rtl8712/usb_intf.c +++ b/drivers/staging/rtl8712/usb_intf.c @@ -292,13 +292,13 @@ static void r8712_usb_dvobj_deinit(struct _adapter *padapter) void rtl871x_intf_stop(struct _adapter *padapter) { /*disable_hw_interrupt*/ - if (padapter->bSurpriseRemoved == false) { + if (!padapter->bSurpriseRemoved) { /*device still exists, so driver can do i/o operation * TODO: */ } /* cancel in irp */ - if (padapter->dvobjpriv.inirp_deinit != NULL) + if (padapter->dvobjpriv.inirp_deinit) padapter->dvobjpriv.inirp_deinit(padapter); /* cancel out irp */ r8712_usb_write_port_cancel(padapter); @@ -318,7 +318,7 @@ void r871x_dev_unload(struct _adapter *padapter) r8712_stop_drv_threads(padapter); /*s5.*/ - if (padapter->bSurpriseRemoved == false) { + if (!padapter->bSurpriseRemoved) { padapter->hw_init_completed = false; rtl8712_hal_deinit(padapter); } @@ -402,7 +402,7 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf, /* step 3. * initialize the dvobj_priv */ - if (padapter->dvobj_init == NULL) + if (!padapter->dvobj_init) goto error; else { status = padapter->dvobj_init(padapter); @@ -568,7 +568,7 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf, ((mac[0] == 0x00) && (mac[1] == 0x00) && (mac[2] == 0x00) && (mac[3] == 0x00) && (mac[4] == 0x00) && (mac[5] == 0x00)) || - (AutoloadFail == false)) { + (!AutoloadFail)) { mac[0] = 0x00; mac[1] = 0xe0; mac[2] = 0x4c; diff --git a/drivers/staging/rtl8712/usb_ops_linux.c b/drivers/staging/rtl8712/usb_ops_linux.c index e89d2b07fcb9..e0a155a4fac1 100644 --- a/drivers/staging/rtl8712/usb_ops_linux.c +++ b/drivers/staging/rtl8712/usb_ops_linux.c @@ -267,7 +267,7 @@ u32 r8712_usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem) if (adapter->bDriverStopped || adapter->bSurpriseRemoved || adapter->pwrctrlpriv.pnp_bstop_trx) return _FAIL; - if ((precvbuf->reuse == false) || (precvbuf->pskb == NULL)) { + if (!precvbuf->reuse == false || !precvbuf->pskb) { precvbuf->pskb = skb_dequeue(&precvpriv->free_recv_skb_queue); if (NULL != precvbuf->pskb) precvbuf->reuse = true; @@ -275,10 +275,10 @@ u32 r8712_usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem) if (precvbuf != NULL) { r8712_init_recvbuf(adapter, precvbuf); /* re-assign for linux based on skb */ - if ((precvbuf->reuse == false) || (precvbuf->pskb == NULL)) { + if (!precvbuf->reuse || !precvbuf->pskb) { precvbuf->pskb = netdev_alloc_skb(adapter->pnetdev, MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ); - if (precvbuf->pskb == NULL) + if (!precvbuf->pskb) return _FAIL; tmpaddr = (addr_t)precvbuf->pskb->data; alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1); -- 2.34.1