staging: wilc1000: Remove braces for single statement 'if' and 'else'
authorChandra S Gorentla <csgorentla@gmail.com>
Sat, 8 Aug 2015 12:11:36 +0000 (17:41 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Aug 2015 22:22:12 +0000 (15:22 -0700)
Fixes the checkpatch.pl warning - braces {} are not necessary for any arm
of this statement

Signed-off-by: Chandra S Gorentla <csgorentla@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/coreconfigurator.c
drivers/staging/wilc1000/host_interface.c
drivers/staging/wilc1000/linux_wlan.c
drivers/staging/wilc1000/wilc_debugfs.c
drivers/staging/wilc1000/wilc_memory.c
drivers/staging/wilc1000/wilc_spi.c
drivers/staging/wilc1000/wilc_strutils.c
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
drivers/staging/wilc1000/wilc_wlan.c

index 93942b211fcd0dd9078e96ca0b52a75c2e71c958..72ff7d42377e22ad4c952942d84bd412acb60fcd 100644 (file)
@@ -706,11 +706,10 @@ u8 *get_tim_elm(u8 *pu8msa, u16 u16RxLen, u16 u16TagParamOffset)
 
        /* Search for the TIM Element Field and return if the element is found */
        while (u16index < (u16RxLen - FCS_LEN)) {
-               if (pu8msa[u16index] == ITIM) {
+               if (pu8msa[u16index] == ITIM)
                        return &pu8msa[u16index];
-               } else {
+               else
                        u16index += (IE_HDR_LEN + pu8msa[u16index + 1]);
-               }
        }
 
        return 0;
@@ -1527,11 +1526,10 @@ s32 further_process_response(u8 *resp,
        u8 cfg_str[256] = {0};
        tenuWIDtype enuWIDtype = WID_UNDEF;
 
-       if (process_wid_num) {
+       if (process_wid_num)
                enuWIDtype = get_wid_type(g_wid_num);
-       } else {
+       else
                enuWIDtype = gastrWIDs[cnt].enuWIDtype;
-       }
 
 
        switch (enuWIDtype) {
index 8b36683ef3353e28161ac1d8a19f582e55c939a3..cc549c2c5213fd1e2f5f63a50d09a138d35165d3 100644 (file)
@@ -1350,11 +1350,10 @@ static s32 Handle_Scan(void *drvHandler, tstrHostIFscanAttr *pstrHostIFscanAttr)
        /*keep the state as is , no need to change it*/
        /* gWFiDrvHandle->enuHostIFstate = HOST_IF_SCANNING; */
 
-       if (pstrWFIDrv->enuHostIFstate == HOST_IF_CONNECTED) {
+       if (pstrWFIDrv->enuHostIFstate == HOST_IF_CONNECTED)
                gbScanWhileConnected = true;
-       } else if (pstrWFIDrv->enuHostIFstate == HOST_IF_IDLE)    {
+       else if (pstrWFIDrv->enuHostIFstate == HOST_IF_IDLE)
                gbScanWhileConnected = false;
-       }
 
        s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, false, (u32)pstrWFIDrv);
 
@@ -2849,11 +2848,10 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
                         * |------------|---------|-------|------------|---------------|----------------|
                         |      6 bytes  | 8 byte  |1 byte |  1 byte    |   16 bytes    |         8 bytes        |*/
 
-                       if (pstrWFIDrv->enuHostIFstate == HOST_IF_CONNECTED) {
+                       if (pstrWFIDrv->enuHostIFstate == HOST_IF_CONNECTED)
                                WILC_memcpy(pu8keybuf, pstrWFIDrv->au8AssociatedBSSID, ETH_ALEN);
-                       } else {
+                       else
                                PRINT_ER("Couldn't handle WPARxGtk while enuHostIFstate is not HOST_IF_CONNECTED\n");
-                       }
 
                        WILC_memcpy(pu8keybuf + 6, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8seq, 8);
 
@@ -4024,11 +4022,10 @@ static void Handle_PowerManagement(void *drvHandler, tstrHostIfPowerMgmtParam *s
 
        strWID.u16WIDid = (u16)WID_POWER_MANAGEMENT;
 
-       if (strPowerMgmtParam->bIsEnabled == true)      {
+       if (strPowerMgmtParam->bIsEnabled == true)
                s8PowerMode = MIN_FAST_PS;
-       } else {
+       else
                s8PowerMode = NO_POWERSAVE;
-       }
        PRINT_D(HOSTINF_DBG, "Handling power mgmt to %d\n", s8PowerMode);
        strWID.ps8WidVal = &s8PowerMode;
        strWID.s32ValueSize = sizeof(char);
@@ -5479,9 +5476,9 @@ s32 host_int_set_join_req(WILC_WFIDrvHandle hWFIDrv, u8 *pu8bssid,
                WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFconnectAttr.pu8IEs,
                            pu8IEs, IEsLen);
        }
-       if (pstrWFIDrv->enuHostIFstate < HOST_IF_CONNECTING) {
+       if (pstrWFIDrv->enuHostIFstate < HOST_IF_CONNECTING)
                pstrWFIDrv->enuHostIFstate = HOST_IF_CONNECTING;
-       else
+       else
                PRINT_D(GENERIC_DBG, "Don't set state to 'connecting' as state is %d\n", pstrWFIDrv->enuHostIFstate);
 
        /* send the message */
index 92aa671ab1fd3f91108182e82432c0a96cad20d7..1384846a5d01740e607ad1f6d205eae09453335f 100644 (file)
@@ -422,11 +422,10 @@ static void isr_bh_routine(struct work_struct *work)
 
        int_rcvdB++;
        PRINT_D(INT_DBG, "Interrupt received BH\n");
-       if (g_linux_wlan->oup.wlan_handle_rx_isr != 0) {
+       if (g_linux_wlan->oup.wlan_handle_rx_isr != 0)
                g_linux_wlan->oup.wlan_handle_rx_isr();
-       } else {
+       else
                PRINT_ER("wlan_handle_rx_isr() hasn't been initialized\n");
-       }
 
 #if (RX_BH_TYPE == RX_BH_THREADED_IRQ)
        return IRQ_HANDLED;
@@ -450,11 +449,10 @@ static int isr_bh_routine(void *vp)
                }
                int_rcvdB++;
                PRINT_D(INT_DBG, "Interrupt received BH\n");
-               if (g_linux_wlan->oup.wlan_handle_rx_isr != 0) {
+               if (g_linux_wlan->oup.wlan_handle_rx_isr != 0)
                        g_linux_wlan->oup.wlan_handle_rx_isr();
-               } else {
+               else
                        PRINT_ER("wlan_handle_rx_isr() hasn't been initialized\n");
-               }
        }
 
        return 0;
@@ -607,22 +605,20 @@ static int linux_wlan_lock_timeout(void *vp, u32 timeout)
 {
        int error = -1;
        PRINT_D(LOCK_DBG, "Locking %p\n", vp);
-       if (vp != NULL) {
+       if (vp != NULL)
                error = down_timeout((struct semaphore *)vp, msecs_to_jiffies(timeout));
-       } else {
+       else
                PRINT_ER("Failed, mutex is NULL\n");
-       }
        return error;
 }
 
 void linux_wlan_unlock(void *vp)
 {
        PRINT_D(LOCK_DBG, "Unlocking %p\n", vp);
-       if (vp != NULL) {
+       if (vp != NULL)
                up((struct semaphore *)vp);
-       } else {
+       else
                PRINT_ER("Failed, mutex is NULL\n");
-       }
 }
 
 static void linux_wlan_init_mutex(char *lockName, void *plock, int count)
@@ -2125,11 +2121,10 @@ static void linux_wlan_tx_complete(void *priv, int status)
 {
 
        struct tx_complete_data *pv_data = (struct tx_complete_data *)priv;
-       if (status == 1) {
+       if (status == 1)
                PRINT_D(TX_DBG, "Packet sent successfully - Size = %d - Address = %p - SKB = %p\n", pv_data->size, pv_data->buff, pv_data->skb);
-       } else {
+       else
                PRINT_D(TX_DBG, "Couldn't send packet - Size = %d - Address = %p - SKB = %p\n", pv_data->size, pv_data->buff, pv_data->skb);
-       }
        /* Free the SK Buffer, its work is done */
        dev_kfree_skb(pv_data->skb);
        linux_wlan_free(pv_data);
index c328208cda29040c8ea8cc4ac8d0ca7a508bcdb6..be2e901b448d485aaf5824f00a47cbd929a21cec 100644 (file)
@@ -62,11 +62,10 @@ static ssize_t wilc_debug_level_write(struct file *filp, const char *buf, size_t
 
        flag = buffer[0] - '0';
 
-       if (flag > 0) {
+       if (flag > 0)
                flag = DEBUG | ERR;
-       } else if (flag < 0) {
+       else if (flag < 0)
                flag = 100;
-       }
 
        if (flag > DBG_LEVEL_ALL) {
                printk("%s, value (0x%08x) is out of range, stay previous flag (0x%08x)\n", __func__, flag, atomic_read(&DEBUG_LEVEL));
@@ -75,11 +74,10 @@ static ssize_t wilc_debug_level_write(struct file *filp, const char *buf, size_t
 
        atomic_set(&DEBUG_LEVEL, (int)flag);
 
-       if (flag == 0) {
+       if (flag == 0)
                printk("Debug-level disabled\n");
-       } else {
+       else
                printk("Debug-level enabled\n");
-       }
        return count;
 }
 
index c70707fefb660eef29858583d54dcff944040ee9..34ef13e8e24329ea369b05c6371dfa65437ed27e 100644 (file)
@@ -9,11 +9,10 @@
 void *WILC_MemoryAlloc(u32 u32Size, tstrWILC_MemoryAttrs *strAttrs,
                       char *pcFileName, u32 u32LineNo)
 {
-       if (u32Size > 0) {
+       if (u32Size > 0)
                return kmalloc(u32Size, GFP_ATOMIC);
-       } else {
+       else
                return NULL;
-       }
 }
 
 /*!
index abea5df656d78ce9ddada4c14755b8b8bae7094c..1bf7d314ae342ed3cbe6237b75b1686e604be1be 100644 (file)
@@ -374,11 +374,10 @@ static int spi_cmd_complete(uint8_t cmd, uint32_t adr, uint8_t *b, uint32_t sz,
                return result;
        }
 
-       if (!g_spi.crc_off) {
+       if (!g_spi.crc_off)
                wb[len - 1] = (crc7(0x7f, (const uint8_t *)&wb[0], len - 1)) << 1;
-       } else {
+       else
                len -= 1;
-       }
 
 #define NUM_SKIP_BYTES (1)
 #define NUM_RSP_BYTES (2)
@@ -522,11 +521,10 @@ static int spi_cmd_complete(uint8_t cmd, uint32_t adr, uint8_t *b, uint32_t sz,
                        if (sz > 0) {
                                int nbytes;
 
-                               if (sz <= (DATA_PKT_SZ - ix)) {
+                               if (sz <= (DATA_PKT_SZ - ix))
                                        nbytes = sz;
-                               } else {
+                               else
                                        nbytes = DATA_PKT_SZ - ix;
-                               }
 
                                /**
                                 * Read bytes
@@ -557,11 +555,10 @@ static int spi_cmd_complete(uint8_t cmd, uint32_t adr, uint8_t *b, uint32_t sz,
                        while (sz > 0) {
                                int nbytes;
 
-                               if (sz <= DATA_PKT_SZ) {
+                               if (sz <= DATA_PKT_SZ)
                                        nbytes = sz;
-                               } else {
+                               else
                                        nbytes = DATA_PKT_SZ;
-                               }
 
                                /**
                                 * read data response only on the next DMA cycles not
index 3600706ed2310f0ed2821f7534446b38c48de80c..a32b9c13e872c8792c9e63f463b8394a0b594cc2 100644 (file)
@@ -41,11 +41,10 @@ s32 WILC_strncmp(const char *pcStr1, const char *pcStr2,
                s32Result = 1;
        } else {
                s32Result = strncmp(pcStr1, pcStr2, u32Count);
-               if (s32Result < 0) {
+               if (s32Result < 0)
                        s32Result = -1;
-               } else if (s32Result > 0)    {
+               else if (s32Result > 0)
                        s32Result = 1;
-               }
        }
 
        return s32Result;
index 97df19393e7f0aa5b7464087e3c60a5b83a781e5..5c459679aa5a135f77f14ec1b24e98a27c0a6f3a 100644 (file)
@@ -443,11 +443,10 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, tstrNetworkInfo *pstrNetwo
                        PRINT_D(CFG80211_DBG, "Refreshing Scan ...\n");
                        refresh_scan(priv, 1, false);
 
-                       if (priv->u32RcvdChCount > 0) {
+                       if (priv->u32RcvdChCount > 0)
                                PRINT_D(CFG80211_DBG, "%d Network(s) found\n", priv->u32RcvdChCount);
-                       } else {
+                       else
                                PRINT_D(CFG80211_DBG, "No networks found\n");
-                       }
 
                        down(&(priv->hSemScanReq));
 
@@ -1686,11 +1685,10 @@ static int WILC_WFI_get_station(struct wiphy *wiphy, struct net_device *dev,
                sinfo->txrate.legacy = strStatistics.u8LinkSpeed * 10;
 
 #ifdef TCP_ENHANCEMENTS
-               if ((strStatistics.u8LinkSpeed > TCP_ACK_FILTER_LINK_SPEED_THRESH) && (strStatistics.u8LinkSpeed != DEFAULT_LINK_SPEED)) {
+               if ((strStatistics.u8LinkSpeed > TCP_ACK_FILTER_LINK_SPEED_THRESH) && (strStatistics.u8LinkSpeed != DEFAULT_LINK_SPEED))
                        Enable_TCP_ACK_Filter(true);
-               } else if (strStatistics.u8LinkSpeed != DEFAULT_LINK_SPEED)   {
+               else if (strStatistics.u8LinkSpeed != DEFAULT_LINK_SPEED)
                        Enable_TCP_ACK_Filter(false);
-               }
 #endif
 
                PRINT_D(CORECONFIG_DBG, "*** stats[%d][%d][%d][%d][%d]\n", sinfo->signal, sinfo->rx_packets, sinfo->tx_packets,
@@ -2059,11 +2057,10 @@ void WILC_WFI_CfgParseRxAction(u8 *buf, u32 len)
                }
                #endif  /* USE_SUPPLICANT_GO_INTENT */
 
-               if (buf[index] ==  CHANLIST_ATTR_ID) {
+               if (buf[index] ==  CHANLIST_ATTR_ID)
                        channel_list_attr_index = index;
-               } else if (buf[index] ==  OPERCHAN_ATTR_ID)   {
+               else if (buf[index] ==  OPERCHAN_ATTR_ID)
                        op_channel_attr_index = index;
-               }
                index += buf[index + 1] + 3; /* ID,Length byte */
        }
 
@@ -2145,11 +2142,10 @@ void WILC_WFI_CfgParseTxAction(u8 *buf, u32 len, bool bOperChan, u8 iftype)
                }
                #endif
 
-               if (buf[index] ==  CHANLIST_ATTR_ID) {
+               if (buf[index] ==  CHANLIST_ATTR_ID)
                        channel_list_attr_index = index;
-               } else if (buf[index] ==  OPERCHAN_ATTR_ID)   {
+               else if (buf[index] ==  OPERCHAN_ATTR_ID)
                        op_channel_attr_index = index;
-               }
                index += buf[index + 1] + 3; /* ID,Length byte */
        }
 
index bd5c2564f313dab819792ef5e6208b50a81e6ddf..192f36cde59e61838b0d16ea9f2a9b454b18f4df 100644 (file)
@@ -463,11 +463,10 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(void)
        Pending_Acks = 0;
        Opened_TCP_session = 0;
 
-       if (PendingAcks_arrBase == 0) {
+       if (PendingAcks_arrBase == 0)
                PendingAcks_arrBase = MAX_TCP_SESSION;
-       } else {
+       else
                PendingAcks_arrBase = 0;
-       }
 
 
        p->os_func.os_spin_unlock(p->txq_spinlock, &p->txq_spinlock_flags);
@@ -1110,11 +1109,10 @@ static int wilc_wlan_handle_txq(uint32_t *pu32TxqCount)
                                /*Bug3959: transmitting mgmt frames received from host*/
                                /*setting bit 30 in the host header to indicate mgmt frame*/
 #ifdef WILC_AP_EXTERNAL_MLME
-                               if (tqe->type == WILC_MGMT_PKT) {
+                               if (tqe->type == WILC_MGMT_PKT)
                                        header |= (1 << 30);
-                               } else {
+                               else
                                        header &= ~(1 << 30);
-                               }
 #endif
 
 #ifdef BIG_ENDIAN
@@ -1541,11 +1539,10 @@ static int wilc_wlan_firmware_download(const uint8_t *buffer, uint32_t buffer_si
                acquire_bus(ACQUIRE_ONLY);
                offset += 8;
                while (((int)size) && (offset < buffer_size)) {
-                       if (size <= blksz) {
+                       if (size <= blksz)
                                size2 = size;
-                       } else {
+                       else
                                size2 = blksz;
-                       }
                        /* Copy firmware into a DMA coherent buffer */
                        memcpy(dma_buffer, &buffer[offset], size2);
                        ret = p->hif_func.hif_block_tx(addr, dma_buffer, size2);
@@ -2302,11 +2299,10 @@ u16 Set_machw_change_vir_if(bool bValue)
                PRINT_ER("Error while Reading reg WILC_CHANGING_VIR_IF\n");
        }
 
-       if (bValue) {
+       if (bValue)
                reg |= (BIT31);
-       } else {
+       else
                reg &= ~(BIT31);
-       }
 
        ret = (&g_wlan)->hif_func.hif_write_reg(WILC_CHANGING_VIR_IF, reg);