staging: rtl8712: Delete explicit comparison with false and NULL
authorTapasweni Pathak <tapaswenipathak@gmail.com>
Mon, 6 Oct 2014 08:53:18 +0000 (14:23 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Oct 2014 02:29:11 +0000 (10:29 +0800)
This patch delete explicit comparison to false and NULL in files of
rtl8712.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/recv_linux.c
drivers/staging/rtl8712/rtl871x_io.c
drivers/staging/rtl8712/rtl871x_ioctl_set.c
drivers/staging/rtl8712/rtl871x_mp.c
drivers/staging/rtl8712/usb_intf.c
drivers/staging/rtl8712/usb_ops_linux.c

index 495ee1205e02a9c77aa59a1e7ec5da1cf255d534..0631f36382574a334a7fc091de967b36e768e8ef 100644 (file)
@@ -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);
 }
index d7b63aedead76d8612d1cd8d68c703ed7bc80764..3a0236606396bca71c210a20b031e6fba341dc16 100644 (file)
@@ -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:
index 9d47eb472837116d2805626d349fdcfc562bbb36..a240b6389683e704bd3b82a746d15c58410fbf2d 100644 (file)
@@ -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)) ||
index 2ec660ad78af55bbed5bf7662f7da95210238feb..3d913b9701bba873179b156aeca303861f01b0dd 100644 (file)
@@ -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);
index a3d733b145ebb9ae241ba54192206046ad907823..da3856dda7283dc36676297dbb3869c4df379010 100644 (file)
@@ -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;
index e89d2b07fcb9f978a6bcb3ae91391bea7f965700..e0a155a4fac1af8f409054710c75dfd83bc4b6e3 100644 (file)
@@ -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);