staging: wilc1000 Fixes for style errors/warnings
This series fix some of the errors and warnings found using checkpatch.pl.
PATCH 1/4 staging: wilc1000: Add space between the braces
Inserted space between nested braces. This fixes the checkpatch.pl error - space required after that close brace '}'.
Signed-off-by Chandra S Gorentla <[email protected]>
--- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +2 -2
@@ -3331,7 +3331,7 @@ static int WILC_WFI_add_station(struct wiphy *wiphy, struct net_device *dev, {s32 s32Error =WILC_SUCCESS ;struct WILC_WFI_priv *priv; -tstrWILC_AddStaParam strStaParams = {{0 }}; +tstrWILC_AddStaParam strStaParams = { {0 } };perInterface_wlan_t *nic;
@@ -3462,7 +3462,7 @@ static int WILC_WFI_change_station(struct wiphy *wiphy, struct net_device *dev, {s32 s32Error =WILC_SUCCESS ;struct WILC_WFI_priv *priv; -tstrWILC_AddStaParam strStaParams = {{0 }}; +tstrWILC_AddStaParam strStaParams = { {0 } };perInterface_wlan_t *nic;
Signature · 1 line
2.5.0
PATCH 2/4 staging: wilc1000: Remove unused extern declarations
'extern' declarations which are not referenced within the file are removed.
Signed-off-by Chandra S Gorentla <[email protected]>
--- drivers/staging/wilc1000/host_interface.c | 1 - drivers/staging/wilc1000/linux_wlan_sdio.c | 1 - drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 -- drivers/staging/wilc1000/wilc_wlan.c | 3 --- 4 files changed, 7 deletions(-)
drivers/staging/wilc1000/host_interface.c +0 -1
@@ -9,7 +9,6 @@ extern u8 connecting;extern WILC_TimerHandle hDuringIpTimer;#endif -extern bool bEnablePS;/*BugID_5137*/ extern u8 g_wilc_initialized;/*****************************************************************************/
drivers/staging/wilc1000/linux_wlan_sdio.c +0 -1
@@ -31,7 +31,6 @@struct sdio_func *local_sdio_func;extern linux_wlan_t *g_linux_wlan;extern int wilc_netdev_init (void ); -extern int sdio_clear_int (void );extern void wilc_handle_isr (void );static unsigned int sdio_default_speed;
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +0 -2
@@ -22,7 +22,6 @@#define IS_MGMT_STATUS_SUCCES 0x040#define GET_PKT_OFFSET (a) (((a) >> 22) & 0x1ff) -extern void linux_wlan_free (void *vp);extern int linux_wlan_get_firmware (perInterface_wlan_t *p_nic);extern void linux_wlan_unlock (void *vp);extern u16 Set_machw_change_vir_if (bool bValue);
@@ -1619,7 +1618,6 @@ static int WILC_WFI_dump_survey(struct wiphy *wiphy, struct net_device *netdev,* @version 1.0 */ -extern uint32_t Statisitcs_totalAcks, Statisitcs_DroppedAcks;static int WILC_WFI_get_station (struct wiphy *wiphy,struct net_device *dev,const u8 *mac,struct station_info *sinfo) {
drivers/staging/wilc1000/wilc_wlan.c +0 -3
@@ -16,7 +16,6 @@* Global * ********************************************/ -extern unsigned int int_clrd;extern wilc_hif_func_t hif_sdio;extern wilc_hif_func_t hif_spi;extern wilc_cfg_func_t mac_cfg;
@@ -24,8 +23,6 @@ extern wilc_cfg_func_t mac_cfg;extern u8 g_wilc_initialized;/* AMR : 0422 RK3026 Crash issue */ #endif extern void WILC_WFI_mgmt_rx (uint8_t *buff,uint32_t size); -extern void frmw_to_linux (uint8_t *buff,uint32_t size); -int sdio_xfer_cnt (void );uint32_t wilc_get_chipid (uint8_t update);u16 Set_machw_change_vir_if (bool bValue);
Signature · 1 line
2.5.0
PATCH 3/4 staging: wilc1000: Remove ' ' before quoted '\n'
Fixes the checkpatch.pl warning -
'unnecessary whitespace before a quoted newline'.
Signed-off-by Chandra S Gorentla <[email protected]>
--- drivers/staging/wilc1000/linux_wlan.c | 20 +++++------ drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 42 +++++++++++------------ drivers/staging/wilc1000/wilc_wlan.c | 10 +++--- drivers/staging/wilc1000/wilc_wlan_cfg.c | 8 ++--- 4 files changed, 40 insertions(+), 40 deletions(-)
drivers/staging/wilc1000/linux_wlan.c +10 -10
@@ -296,7 +296,7 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long eventPRINT_D (GENERIC_DBG ,"[%s] Up IP\n" , dev_iface->ifa_label); pIP_Add_buff = (char *) (&(dev_iface->ifa_address)); -PRINT_D (GENERIC_DBG ,"IP add=%d:%d:%d:%d \n" , pIP_Add_buff[0 ], pIP_Add_buff[1 ], pIP_Add_buff[2 ], pIP_Add_buff[3 ]); +PRINT_D (GENERIC_DBG ,"IP add=%d:%d:%d:%d\n" , pIP_Add_buff[0 ], pIP_Add_buff[1 ], pIP_Add_buff[2 ], pIP_Add_buff[3 ]);host_int_setup_ipaddress ((WILC_WFIDrvHandle )pstrWFIDrv, pIP_Add_buff, nic->u8IfIdx);break ;
@@ -318,7 +318,7 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long eventPRINT_D (GENERIC_DBG ,"[%s] Down IP\n" , dev_iface->ifa_label); pIP_Add_buff = null_ip; -PRINT_D (GENERIC_DBG ,"IP add=%d:%d:%d:%d \n" , pIP_Add_buff[0 ], pIP_Add_buff[1 ], pIP_Add_buff[2 ], pIP_Add_buff[3 ]); +PRINT_D (GENERIC_DBG ,"IP add=%d:%d:%d:%d\n" , pIP_Add_buff[0 ], pIP_Add_buff[1 ], pIP_Add_buff[2 ], pIP_Add_buff[3 ]);host_int_setup_ipaddress ((WILC_WFIDrvHandle )pstrWFIDrv, pIP_Add_buff, nic->u8IfIdx);
@@ -1020,7 +1020,7 @@ static int linux_wlan_firmware_download(linux_wlan_t *p_nic)release_firmware (g_linux_wlan->wilc_firmware); g_linux_wlan->wilc_firmware =NULL ; -PRINT_D (INIT_DBG ,"Download Succeeded \n" ); +PRINT_D (INIT_DBG ,"Download Succeeded\n" ); _FAIL_:return ret;
@@ -1774,7 +1774,7 @@ int repeat_power_cycle(perInterface_wlan_t *nic)#endif if (linux_wlan_get_firmware (nic)) { -PRINT_ER ("Can't get firmware \n" ); +PRINT_ER ("Can't get firmware\n" ); ret =-1 ; goto __fail__; }
@@ -1859,7 +1859,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)#endif if (linux_wlan_get_firmware (nic)) { -PRINT_ER ("Can't get firmware \n" ); +PRINT_ER ("Can't get firmware\n" ); ret = -EIO ; goto _fail_irq_enable_; }
@@ -2080,13 +2080,13 @@ static void wilc_set_multicast_list(struct net_device *dev)if (!dev)return ; -PRINT_D (INIT_DBG ,"Setting Multicast List with count = %d. \n" , dev->mc.count); +PRINT_D (INIT_DBG ,"Setting Multicast List with count = %d.\n" , dev->mc.count);if (dev->flags &IFF_PROMISC ) {/* Normally, we should configure the chip to retrive all packets * but we don't wanna support this right now */ /* TODO: add promiscuous mode support */ -PRINT_D (INIT_DBG ,"Set promiscuous mode ON, retrive all packets \n" ); +PRINT_D (INIT_DBG ,"Set promiscuous mode ON, retrive all packets\n" );return ; }
@@ -2145,7 +2145,7 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)struct ethhdr *eth_h; nic =netdev_priv (ndev); -PRINT_D (INT_DBG ,"\n========\n IntUH: %d - IntBH: %d - IntCld: %d \n========\n" , int_rcvdU, int_rcvdB, int_clrd); +PRINT_D (INT_DBG ,"\n========\n IntUH: %d - IntBH: %d - IntCld: %d\n========\n" , int_rcvdU, int_rcvdB, int_clrd);PRINT_D (TX_DBG ,"Sending packet just received from TCP/IP\n" );/* Stop the network interface queue */
@@ -2551,7 +2551,7 @@ int wilc_netdev_init(void)#ifndef WILC_SDIO if (!linux_spi_init (&g_linux_wlan->wilc_spidev)) { -PRINT_ER ("Can't initialize SPI \n" ); +PRINT_ER ("Can't initialize SPI\n" );return -1 ;/* ERROR */ } g_linux_wlan->wilc_spidev = wilc_spi_dev;
@@ -2636,7 +2636,7 @@ static void __exit exit_wilc_driver(void) } }for (i =0 ; i <NUM_CONCURRENT_IFC ; i++) { -PRINT_D (INIT_DBG ,"Unregistering netdev %p \n" , g_linux_wlan->strInterfaceInfo[i].wilc_netdev); +PRINT_D (INIT_DBG ,"Unregistering netdev %p\n" , g_linux_wlan->strInterfaceInfo[i].wilc_netdev);unregister_netdev (g_linux_wlan->strInterfaceInfo[i].wilc_netdev);#ifdef USE_WIRELESS PRINT_D (INIT_DBG ,"Freeing Wiphy...\n" );
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +21 -21
150 lines not on this page · raw message
drivers/staging/wilc1000/wilc_wlan.c +5 -5
@@ -447,7 +447,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(void)for (i = PendingAcks_arrBase; i < (PendingAcks_arrBase + Pending_Acks); i++) {if (Pending_Acks_info[i].ack_num < Acks_keep_track_info[Pending_Acks_info[i].Session_index].Bigger_Ack_num) {struct txq_entry_t *tqe; -PRINT_D (TCP_ENH ,"DROP ACK: %u \n" , Pending_Acks_info[i].ack_num); +PRINT_D (TCP_ENH ,"DROP ACK: %u\n" , Pending_Acks_info[i].ack_num); tqe = Pending_Acks_info[i].txqe;if (tqe) {wilc_wlan_txq_remove (tqe);
@@ -992,7 +992,7 @@ static int wilc_wlan_handle_txq(uint32_t *pu32TxqCount)/** * wait for vmm table is ready **/ -PRINT_WRN (GENERIC_DBG ,"[wilc txq]: warn, vmm table not clear yet, wait... \n" ); +PRINT_WRN (GENERIC_DBG ,"[wilc txq]: warn, vmm table not clear yet, wait...\n" );release_bus (RELEASE_ALLOW_SLEEP ); p->os_func.os_sleep (3 );/* wait 3 ms */ acquire_bus (ACQUIRE_AND_WAKEUP );
@@ -1059,7 +1059,7 @@ static int wilc_wlan_handle_txq(uint32_t *pu32TxqCount) }if (entries ==0 ) { -PRINT_WRN (GENERIC_DBG ,"[wilc txq]: no more buffer in the chip (reg: %08x), retry later [[ %d, %x ]] \n" , reg, i, vmm_table[i -1 ]); +PRINT_WRN (GENERIC_DBG ,"[wilc txq]: no more buffer in the chip (reg: %08x), retry later [[ %d, %x ]]\n" , reg, i, vmm_table[i -1 ]);/* undo the transaction. */ ret = p->hif_func.hif_read_reg (WILC_HOST_TX_CTRL , ®);
@@ -1209,7 +1209,7 @@ static void wilc_wlan_handle_rxq(void) do { if (p->quit) { - PRINT_D(RX_DBG, "exit 1st do-while due to Clean_UP function \n"); + PRINT_D(RX_DBG, "exit 1st do-while due to Clean_UP function\n"); p->os_func.os_signal(p->cfg_wait); break; }
@@ -1326,7 +1326,7 @@ static void wilc_wlan_handle_rxq(void) }while (1 ); p->rxq_exit =1 ; -PRINT_D (RX_DBG ,"THREAD: Exiting RX thread \n" ); +PRINT_D (RX_DBG ,"THREAD: Exiting RX thread\n" );return ; }
drivers/staging/wilc1000/wilc_wlan_cfg.c +4 -4
@@ -551,7 +551,7 @@ static int wilc_wlan_cfg_indicate_rx(uint8_t *frame, int size, wilc_cfg_rsp_t *rcase 'L' :#ifndef SWITCH_LOG_TERMINAL -PRINT_ER ("Unexpected firmware log message received \n" ); +PRINT_ER ("Unexpected firmware log message received\n" );#else PRINT_D (FIRM_DBG ,"\nFIRMWARE LOGS :\n<<\n%s\n>>\n" , frame);break ;
@@ -566,18 +566,18 @@ static int wilc_wlan_cfg_indicate_rx(uint8_t *frame, int size, wilc_cfg_rsp_t *r#endif /*bug3819:*/ case 'S' : -PRINT_INFO (RX_DBG ,"Scan Notification Received \n" ); +PRINT_INFO (RX_DBG ,"Scan Notification Received\n" );host_int_ScanCompleteReceived (frame -4 , size +4 );break ;#ifdef WILC_FULLY_HOSTING_AP case 'T' : -PRINT_INFO (RX_DBG ,"TBTT Notification Received \n" ); +PRINT_INFO (RX_DBG ,"TBTT Notification Received\n" );process_tbtt_isr ();break ;case 'A' : -PRINT_INFO (RX_DBG ,"HOSTAPD ACK Notification Received \n" ); +PRINT_INFO (RX_DBG ,"HOSTAPD ACK Notification Received\n" );WILC_mgm_HOSTAPD_ACK (ptru32Frame, bStatus);break ;#endif
Signature · 1 line
2.5.0
PATCH 4/4 staging: wilc1000: Remove braces for single statement 'if' and 'else'
Fixes the checkpatch.pl warning - braces {} are not necessary for any arm of this statement
Signed-off-by Chandra S Gorentla <[email protected]>
--- drivers/staging/wilc1000/coreconfigurator.c | 10 ++++----- drivers/staging/wilc1000/host_interface.c | 19 ++++++++--------- drivers/staging/wilc1000/linux_wlan.c | 25 +++++++++-------------- drivers/staging/wilc1000/wilc_debugfs.c | 10 ++++----- drivers/staging/wilc1000/wilc_memory.c | 5 ++--- drivers/staging/wilc1000/wilc_spi.c | 15 ++++++-------- drivers/staging/wilc1000/wilc_strutils.c | 5 ++--- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 20 ++++++++---------- drivers/staging/wilc1000/wilc_wlan.c | 20 ++++++++---------- 9 files changed, 52 insertions(+), 77 deletions(-)
drivers/staging/wilc1000/coreconfigurator.c +4 -6
@@ -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) {
drivers/staging/wilc1000/host_interface.c +8 -11
@@ -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 */
drivers/staging/wilc1000/linux_wlan.c +10 -15
@@ -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);
drivers/staging/wilc1000/wilc_debugfs.c +4 -6
@@ -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_tatomic_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; }
drivers/staging/wilc1000/wilc_memory.c +2 -3
@@ -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 ; - } }/*!
drivers/staging/wilc1000/wilc_spi.c +6 -9
@@ -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
drivers/staging/wilc1000/wilc_strutils.c +2 -3
@@ -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;
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +8 -12
@@ -443,11 +443,10 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, tstrNetworkInfo *pstrNetwoPRINT_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));
@@ -1685,11 +1684,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,
@@ -2058,11 +2056,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 */ }
@@ -2144,11 +2141,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 */ }
drivers/staging/wilc1000/wilc_wlan.c +8 -12
@@ -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_siacquire_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);
Signature · 1 line
2.5.0