Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78174ada authored by Chandra S Gorentla's avatar Chandra S Gorentla Committed by Greg Kroah-Hartman
Browse files

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: default avatarChandra S Gorentla <csgorentla@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 17aacd43
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -706,12 +706,11 @@ 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) {
+8 −11
Original line number Diff line number Diff line
@@ -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 */
+10 −15
Original line number Diff line number Diff line
@@ -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,12 +449,11 @@ 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,23 +605,21 @@ 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);
+4 −6
Original line number Diff line number Diff line
@@ -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;
}

+2 −3
Original line number Diff line number Diff line
@@ -9,12 +9,11 @@
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;
}
}

/*!
 *  @author	syounan
Loading