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

Commit 1ca96884 authored by Luis de Bethencourt's avatar Luis de Bethencourt Committed by Greg Kroah-Hartman
Browse files

staging: rtl8712: Remove boolean comparisons



Boolean tests do not need explicit comparison to true or false.

Signed-off-by: default avatarLuis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cf31378b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ static int r871x_net_set_mac_address(struct net_device *pnetdev, void *p)
	struct _adapter *padapter = netdev_priv(pnetdev);
	struct sockaddr *addr = p;

	if (padapter->bup == false)
	if (!padapter->bup)
		ether_addr_copy(pnetdev->dev_addr, addr->sa_data);
	return 0;
}
@@ -384,7 +384,7 @@ static int netdev_open(struct net_device *pnetdev)
	struct _adapter *padapter = netdev_priv(pnetdev);

	mutex_lock(&padapter->mutex_start);
	if (padapter->bup == false) {
	if (!padapter->bup) {
		padapter->bDriverStopped = false;
		padapter->bSurpriseRemoved = false;
		padapter->bup = true;
+4 −5
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ static void query_fw_rx_phy_status(struct _adapter *padapter)
	u32 val32 = 0;
	int pollingcnts = 50;

	if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) == true) {
	if (check_fwstate(&padapter->mlmepriv, _FW_LINKED)) {
		r8712_write32(padapter, IOCMD_CTRL_REG, 0xf4000001);
		msleep(100);
		/* Wait FW complete IO Cmd */
@@ -324,8 +324,7 @@ int r8712_cmd_thread(void *context)
	while (1) {
		if ((_down_sema(&(pcmdpriv->cmd_queue_sema))) == _FAIL)
			break;
		if ((padapter->bDriverStopped == true) ||
		    (padapter->bSurpriseRemoved == true))
		if (padapter->bDriverStopped || padapter->bSurpriseRemoved)
			break;
		if (r8712_register_cmd_alive(padapter) != _SUCCESS)
			continue;
@@ -375,8 +374,8 @@ int r8712_cmd_thread(void *context)
			pcmdbuf += 2; /* 8 bytes alignment */
			memcpy((u8 *)pcmdbuf, pcmd->parmbuf, pcmd->cmdsz);
			while (check_cmd_fifo(padapter, wr_sz) == _FAIL) {
				if ((padapter->bDriverStopped == true) ||
				    (padapter->bSurpriseRemoved == true))
				if (padapter->bDriverStopped ||
				    padapter->bSurpriseRemoved)
					break;
				msleep(100);
				continue;
+26 −30
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ static void efuse_reg_ctrl(struct _adapter *padapter, u8 bPowerOn)
{
	u8 tmpu8 = 0;

	if (true == bPowerOn) {
	if (bPowerOn) {
		/* -----------------e-fuse pwr & clk reg ctrl ---------------
		 * Enable LDOE25 Macro Block
		 */
@@ -127,7 +127,7 @@ static u8 efuse_one_byte_rw(struct _adapter *padapter, u8 bRead, u16 addr,
	tmpv8 = ((u8)((addr >> 8) & 0x03)) |
		 (r8712_read8(padapter, EFUSE_CTRL + 2) & 0xFC);
	r8712_write8(padapter, EFUSE_CTRL+2, tmpv8);
	if (true == bRead) {
	if (bRead) {
		r8712_write8(padapter, EFUSE_CTRL+3,  0x72); /* read cmd */
		while (!(0x80 & r8712_read8(padapter, EFUSE_CTRL+3)) &&
		       (tmpidx < 100))
@@ -158,7 +158,7 @@ static u8 efuse_is_empty(struct _adapter *padapter, u8 *empty)
	u8 value, ret = true;

	/* read one byte to check if E-Fuse is empty */
	if (efuse_one_byte_rw(padapter, true, 0, &value) == true) {
	if (efuse_one_byte_rw(padapter, true, 0, &value)) {
		if (0xFF == value)
			*empty = true;
		else
@@ -250,8 +250,7 @@ u8 r8712_efuse_pg_packet_read(struct _adapter *padapter, u8 offset, u8 *data)
		return false;
	memset(data, 0xFF, sizeof(u8)*PGPKT_DATA_SIZE);
	while (efuse_addr < efuse_available_max_size) {
		if (efuse_one_byte_read(padapter, efuse_addr, &efuse_data) ==
		    true) {
		if (efuse_one_byte_read(padapter, efuse_addr, &efuse_data)) {
			if (efuse_data == 0xFF)
				break;
			hoffset = (efuse_data >> 4) & 0x0F;
@@ -262,8 +261,7 @@ u8 r8712_efuse_pg_packet_read(struct _adapter *padapter, u8 offset, u8 *data)
				for (tmpidx = 0; tmpidx < word_cnts * 2;
				     tmpidx++) {
					if (efuse_one_byte_read(padapter,
					    efuse_addr+1+tmpidx, &efuse_data) ==
					     true) {
					    efuse_addr+1+tmpidx, &efuse_data)) {
						tmpdata[tmpidx] = efuse_data;
					} else
						ret = false;
@@ -295,7 +293,7 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr)
	/* retrieve original data */
	addr = 0;
	while (addr < header_addr) {
		if (efuse_one_byte_read(padapter, addr++, &value) == false) {
		if (!efuse_one_byte_read(padapter, addr++, &value)) {
			ret = false;
			break;
		}
@@ -310,14 +308,14 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr)
				if (BIT(i) & pkt.word_en) {
					if (efuse_one_byte_read(
							padapter, addr,
							&value) == true)
							&value))
						pkt.data[i*2] = value;
					else
						return false;
					if (efuse_one_byte_read(
							padapter,
							addr + 1,
							&value) == true)
							&value))
						pkt.data[i*2 + 1] =
							value;
					else
@@ -337,8 +335,7 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr)
			efuse_one_byte_write(padapter, addr+1,
					pkt.data[i*2 + 1]);
			/* additional check */
			if (efuse_one_byte_read(padapter, addr, &value)
				== false)
			if (!efuse_one_byte_read(padapter, addr, &value))
				ret = false;
			else if (pkt.data[i*2] != value) {
				ret = false;
@@ -346,8 +343,7 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr)
					efuse_one_byte_write(padapter, addr,
							pkt.data[i * 2]);
			}
			if (efuse_one_byte_read(padapter, addr+1, &value) ==
				false)
			if (!efuse_one_byte_read(padapter, addr+1, &value))
				ret = false;
			else if (pkt.data[i*2 + 1] != value) {
				ret = false;
@@ -388,8 +384,8 @@ u8 r8712_efuse_pg_packet_write(struct _adapter *padapter, const u8 offset,
		efuse_one_byte_write(padapter, efuse_addr, pg_header); /*hdr*/
		sub_repeat = 0;
		/* check if what we read is what we write */
		while (efuse_one_byte_read(padapter, efuse_addr,
					   &efuse_data) == false) {
		while (!efuse_one_byte_read(padapter, efuse_addr,
					    &efuse_data)) {
			if (++sub_repeat > _REPEAT_THRESHOLD_) {
				bResult = false; /* continue to blind write */
				break; /* continue to blind write */
@@ -406,8 +402,9 @@ u8 r8712_efuse_pg_packet_write(struct _adapter *padapter, const u8 offset,
				efuse_one_byte_write(padapter,
						     efuse_addr + i,
						     *(data + i));
				if (efuse_one_byte_read(padapter,
				    efuse_addr + i, &efuse_data) == false)
				if (!efuse_one_byte_read(padapter,
							 efuse_addr + i,
							 &efuse_data))
					bResult = false;
				else if (*(data+i) != efuse_data) /* fail */
					bResult = false;
@@ -437,10 +434,10 @@ u8 r8712_efuse_access(struct _adapter *padapter, u8 bRead, u16 start_addr,

	if (start_addr > EFUSE_MAX_SIZE)
		return false;
	if ((bRead == false) && ((start_addr + cnts) >
	if (!bRead && ((start_addr + cnts) >
	   efuse_available_max_size))
		return false;
	if ((false == bRead) && (r8712_efuse_reg_init(padapter) == false))
	if (!bRead && !r8712_efuse_reg_init(padapter))
		return false;
	/* -----------------e-fuse one byte read / write ---------------------*/
	for (i = 0; i < cnts; i++) {
@@ -450,10 +447,10 @@ u8 r8712_efuse_access(struct _adapter *padapter, u8 bRead, u16 start_addr,
		}
		res = efuse_one_byte_rw(padapter, bRead, start_addr + i,
		      data + i);
		if ((false == bRead) && (false == res))
		if (!bRead && !res)
			break;
	}
	if (false == bRead)
	if (!bRead)
		r8712_efuse_reg_uninit(padapter);
	return res;
}
@@ -466,8 +463,7 @@ u8 r8712_efuse_map_read(struct _adapter *padapter, u16 addr, u16 cnts, u8 *data)

	if ((addr + cnts) > EFUSE_MAP_MAX_SIZE)
		return false;
	if ((efuse_is_empty(padapter, &offset) == true) && (offset ==
	     true)) {
	if (efuse_is_empty(padapter, &offset) && offset) {
		for (i = 0; i < cnts; i++)
			data[i] = 0xFF;
		return ret;
@@ -504,13 +500,13 @@ u8 r8712_efuse_map_write(struct _adapter *padapter, u16 addr, u16 cnts,
	empty = r8712_read8(padapter, EFUSE_CLK_CTRL);
	if (empty != 0x03)
		return false;
	if (efuse_is_empty(padapter, &empty) == true) {
		if (true == empty)
	if (efuse_is_empty(padapter, &empty)) {
		if (empty)
			memset(pktdata, 0xFF, PGPKT_DATA_SIZE);
	} else
		return false;
	offset = (addr >> 3) & 0xF;
	if (empty == false)
	if (!empty)
		if (!r8712_efuse_pg_packet_read(padapter, offset, pktdata))
			return false;
	word_en = 0xF;
@@ -554,13 +550,13 @@ u8 r8712_efuse_map_write(struct _adapter *padapter, u16 addr, u16 cnts,
		}

		if (word_en != 0xF)
			if (r8712_efuse_pg_packet_write(padapter, offset,
			    word_en, newdata) == false)
			if (!r8712_efuse_pg_packet_write(padapter, offset,
							 word_en, newdata))
				return false;
		if (idx == cnts)
			break;
		offset++;
		if (empty == false)
		if (!empty)
			if (!r8712_efuse_pg_packet_read(padapter, offset,
			    pktdata))
				return false;
+2 −4
Original line number Diff line number Diff line
@@ -102,8 +102,7 @@ void r8712_read_mem(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)

	void (*_read_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt,
			  u8 *pmem);
	if ((adapter->bDriverStopped == true) ||
	    (adapter->bSurpriseRemoved == true))
	if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
		return;
	_read_mem = pintfhdl->io_ops._read_mem;
	_read_mem(pintfhdl, addr, cnt, pmem);
@@ -127,8 +126,7 @@ void r8712_read_port(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)

	u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt,
			  u8 *pmem);
	if ((adapter->bDriverStopped == true) ||
	    (adapter->bSurpriseRemoved == true))
	if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
		return;
	_read_port = pintfhdl->io_ops._read_port;
	_read_port(pintfhdl, addr, cnt, pmem);
+80 −84
Original line number Diff line number Diff line
@@ -122,8 +122,7 @@ static void SwLedOn(struct _adapter *padapter, struct LED_871x *pLed)
{
	u8	LedCfg;

	if ((padapter->bSurpriseRemoved == true) ||
	    (padapter->bDriverStopped == true))
	if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
		return;
	LedCfg = r8712_read8(padapter, LEDCFG);
	switch (pLed->LedPin) {
@@ -151,8 +150,7 @@ static void SwLedOff(struct _adapter *padapter, struct LED_871x *pLed)
{
	u8	LedCfg;

	if ((padapter->bSurpriseRemoved == true) ||
	    (padapter->bDriverStopped == true))
	if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
		return;
	LedCfg = r8712_read8(padapter, LEDCFG);
	switch (pLed->LedPin) {
@@ -222,10 +220,10 @@ static void SwLedBlink(struct LED_871x *pLed)
			bStopBlinking = true;
		break;
	case LED_BLINK_StartToBlink:
		if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) &&
		if (check_fwstate(pmlmepriv, _FW_LINKED) &&
		    (pmlmepriv->fw_state & WIFI_STATION_STATE))
			bStopBlinking = true;
		if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) &&
		if (check_fwstate(pmlmepriv, _FW_LINKED) &&
		    ((pmlmepriv->fw_state & WIFI_ADHOC_STATE) ||
		    (pmlmepriv->fw_state & WIFI_ADHOC_MASTER_STATE)))
			bStopBlinking = true;
@@ -241,11 +239,10 @@ static void SwLedBlink(struct LED_871x *pLed)
		break;
	}
	if (bStopBlinking) {
		if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) &&
		    (pLed->bLedOn == false))
		if (check_fwstate(pmlmepriv, _FW_LINKED) &&
		    !pLed->bLedOn)
			SwLedOn(padapter, pLed);
		else if ((check_fwstate(pmlmepriv, _FW_LINKED) ==
			 true) &&  pLed->bLedOn == true)
		else if (check_fwstate(pmlmepriv, _FW_LINKED) &&  pLed->bLedOn)
			SwLedOff(padapter, pLed);
		pLed->BlinkTimes = 0;
		pLed->bLedBlinkInProgress = false;
@@ -296,7 +293,7 @@ static void SwLedBlink1(struct LED_871x *pLed)
	else
		SwLedOff(padapter, pLed);
	if (peeprompriv->CustomerID == RT_CID_DEFAULT) {
		if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
		if (check_fwstate(pmlmepriv, _FW_LINKED)) {
			if (!pLed1->bSWLedCtrl) {
				SwLedOn(padapter, pLed1);
				pLed1->bSWLedCtrl = true;
@@ -332,7 +329,7 @@ static void SwLedBlink1(struct LED_871x *pLed)
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
			if (check_fwstate(pmlmepriv, _FW_LINKED)) {
				pLed->bLedLinkBlinkInProgress = true;
				pLed->CurrLedState = LED_BLINK_NORMAL;
				if (pLed->bLedOn)
@@ -366,7 +363,7 @@ static void SwLedBlink1(struct LED_871x *pLed)
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
			if (check_fwstate(pmlmepriv, _FW_LINKED)) {
				pLed->bLedLinkBlinkInProgress = true;
				pLed->CurrLedState = LED_BLINK_NORMAL;
				if (pLed->bLedOn)
@@ -446,7 +443,7 @@ static void SwLedBlink2(struct LED_871x *pLed)
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
			if (check_fwstate(pmlmepriv, _FW_LINKED)) {
				pLed->CurrLedState = LED_ON;
				pLed->BlinkingLedState = LED_ON;
				SwLedOn(padapter, pLed);
@@ -470,7 +467,7 @@ static void SwLedBlink2(struct LED_871x *pLed)
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
			if (check_fwstate(pmlmepriv, _FW_LINKED)) {
				pLed->CurrLedState = LED_ON;
				pLed->BlinkingLedState = LED_ON;
				SwLedOn(padapter, pLed);
@@ -512,7 +509,7 @@ static void SwLedBlink3(struct LED_871x *pLed)
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
			if (check_fwstate(pmlmepriv, _FW_LINKED)) {
				pLed->CurrLedState = LED_ON;
				pLed->BlinkingLedState = LED_ON;
				if (!pLed->bLedOn)
@@ -538,7 +535,7 @@ static void SwLedBlink3(struct LED_871x *pLed)
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
			if (check_fwstate(pmlmepriv, _FW_LINKED)) {
				pLed->CurrLedState = LED_ON;
				pLed->BlinkingLedState = LED_ON;
				if (!pLed->bLedOn)
@@ -827,8 +824,7 @@ static void BlinkTimerCallback(unsigned long data)

	/* This fixed the crash problem on Fedora 12 when trying to do the
	 * insmod;ifconfig up;rmmod commands. */
	if ((pLed->padapter->bSurpriseRemoved == true) ||
	    (pLed->padapter->bDriverStopped == true))
	if (pLed->padapter->bSurpriseRemoved || pLed->padapter->bDriverStopped)
		return;
	schedule_work(&pLed->BlinkWorkItem);
}
@@ -893,15 +889,15 @@ static void SwLedControlMode1(struct _adapter *padapter,
	switch (LedAction) {
	case LED_CTL_START_TO_LINK:
	case LED_CTL_NO_LINK:
		if (pLed->bLedNoLinkBlinkInProgress == false) {
		if (!pLed->bLedNoLinkBlinkInProgress) {
			if (pLed->CurrLedState == LED_SCAN_BLINK ||
			  IS_LED_WPS_BLINKING(pLed))
				return;
			if (pLed->bLedLinkBlinkInProgress == true) {
			if (pLed->bLedLinkBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedLinkBlinkInProgress = false;
			}
			if (pLed->bLedBlinkInProgress == true) {
			if (pLed->bLedBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedBlinkInProgress = false;
			}
@@ -916,15 +912,15 @@ static void SwLedControlMode1(struct _adapter *padapter,
		}
		break;
	case LED_CTL_LINK:
		if (pLed->bLedLinkBlinkInProgress == false) {
		if (!pLed->bLedLinkBlinkInProgress) {
			if (pLed->CurrLedState == LED_SCAN_BLINK ||
			    IS_LED_WPS_BLINKING(pLed))
				return;
			if (pLed->bLedNoLinkBlinkInProgress == true) {
			if (pLed->bLedNoLinkBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedNoLinkBlinkInProgress = false;
			}
			if (pLed->bLedBlinkInProgress == true) {
			if (pLed->bLedBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedBlinkInProgress = false;
			}
@@ -939,21 +935,21 @@ static void SwLedControlMode1(struct _adapter *padapter,
		}
		break;
	case LED_CTL_SITE_SURVEY:
		if ((psitesurveyctrl->traffic_busy) &&
		    (check_fwstate(pmlmepriv, _FW_LINKED) == true))
		if (psitesurveyctrl->traffic_busy &&
		    check_fwstate(pmlmepriv, _FW_LINKED))
			; /* dummy branch */
		 else if (pLed->bLedScanBlinkInProgress == false) {
		 else if (!pLed->bLedScanBlinkInProgress) {
			if (IS_LED_WPS_BLINKING(pLed))
				return;
			if (pLed->bLedNoLinkBlinkInProgress == true) {
			if (pLed->bLedNoLinkBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedNoLinkBlinkInProgress = false;
			}
			if (pLed->bLedLinkBlinkInProgress == true) {
			if (pLed->bLedLinkBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				 pLed->bLedLinkBlinkInProgress = false;
			}
			if (pLed->bLedBlinkInProgress == true) {
			if (pLed->bLedBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedBlinkInProgress = false;
			}
@@ -970,15 +966,15 @@ static void SwLedControlMode1(struct _adapter *padapter,
		break;
	case LED_CTL_TX:
	case LED_CTL_RX:
		if (pLed->bLedBlinkInProgress == false) {
		if (!pLed->bLedBlinkInProgress) {
			if (pLed->CurrLedState == LED_SCAN_BLINK ||
			    IS_LED_WPS_BLINKING(pLed))
				return;
			if (pLed->bLedNoLinkBlinkInProgress == true) {
			if (pLed->bLedNoLinkBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedNoLinkBlinkInProgress = false;
			}
			if (pLed->bLedLinkBlinkInProgress == true) {
			if (pLed->bLedLinkBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedLinkBlinkInProgress = false;
			}
@@ -996,20 +992,20 @@ static void SwLedControlMode1(struct _adapter *padapter,

	case LED_CTL_START_WPS: /*wait until xinpin finish */
	case LED_CTL_START_WPS_BOTTON:
		 if (pLed->bLedWPSBlinkInProgress == false) {
			if (pLed->bLedNoLinkBlinkInProgress == true) {
		 if (!pLed->bLedWPSBlinkInProgress) {
			if (pLed->bLedNoLinkBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedNoLinkBlinkInProgress = false;
			}
			if (pLed->bLedLinkBlinkInProgress == true) {
			if (pLed->bLedLinkBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				 pLed->bLedLinkBlinkInProgress = false;
			}
			if (pLed->bLedBlinkInProgress == true) {
			if (pLed->bLedBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedBlinkInProgress = false;
			}
			if (pLed->bLedScanBlinkInProgress == true) {
			if (pLed->bLedScanBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedScanBlinkInProgress = false;
			}
@@ -1024,19 +1020,19 @@ static void SwLedControlMode1(struct _adapter *padapter,
		}
		break;
	case LED_CTL_STOP_WPS:
		if (pLed->bLedNoLinkBlinkInProgress == true) {
		if (pLed->bLedNoLinkBlinkInProgress) {
			del_timer(&pLed->BlinkTimer);
			pLed->bLedNoLinkBlinkInProgress = false;
		}
		if (pLed->bLedLinkBlinkInProgress == true) {
		if (pLed->bLedLinkBlinkInProgress) {
			del_timer(&pLed->BlinkTimer);
			 pLed->bLedLinkBlinkInProgress = false;
		}
		if (pLed->bLedBlinkInProgress == true) {
		if (pLed->bLedBlinkInProgress) {
			del_timer(&pLed->BlinkTimer);
			pLed->bLedBlinkInProgress = false;
		}
		if (pLed->bLedScanBlinkInProgress == true) {
		if (pLed->bLedScanBlinkInProgress) {
			del_timer(&pLed->BlinkTimer);
			pLed->bLedScanBlinkInProgress = false;
		}
@@ -1111,11 +1107,11 @@ static void SwLedControlMode2(struct _adapter *padapter,
	case LED_CTL_SITE_SURVEY:
		 if (pmlmepriv->sitesurveyctrl.traffic_busy)
			; /* dummy branch */
		 else if (pLed->bLedScanBlinkInProgress == false) {
		 else if (!pLed->bLedScanBlinkInProgress) {
			if (IS_LED_WPS_BLINKING(pLed))
				return;

			if (pLed->bLedBlinkInProgress == true) {
			if (pLed->bLedBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedBlinkInProgress = false;
			}
@@ -1133,8 +1129,8 @@ static void SwLedControlMode2(struct _adapter *padapter,

	case LED_CTL_TX:
	case LED_CTL_RX:
		if ((pLed->bLedBlinkInProgress == false) &&
		   (check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
		if (!pLed->bLedBlinkInProgress &&
		    check_fwstate(pmlmepriv, _FW_LINKED)) {
			if (pLed->CurrLedState == LED_SCAN_BLINK ||
			   IS_LED_WPS_BLINKING(pLed))
				return;
@@ -1168,12 +1164,12 @@ static void SwLedControlMode2(struct _adapter *padapter,

	case LED_CTL_START_WPS: /*wait until xinpin finish*/
	case LED_CTL_START_WPS_BOTTON:
		if (pLed->bLedWPSBlinkInProgress == false) {
			if (pLed->bLedBlinkInProgress == true) {
		if (!pLed->bLedWPSBlinkInProgress) {
			if (pLed->bLedBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedBlinkInProgress = false;
			}
			if (pLed->bLedScanBlinkInProgress == true) {
			if (pLed->bLedScanBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedScanBlinkInProgress = false;
			}
@@ -1244,10 +1240,10 @@ static void SwLedControlMode3(struct _adapter *padapter,
	case LED_CTL_SITE_SURVEY:
		if (pmlmepriv->sitesurveyctrl.traffic_busy)
			; /* dummy branch */
		else if (pLed->bLedScanBlinkInProgress == false) {
		else if (!pLed->bLedScanBlinkInProgress) {
			if (IS_LED_WPS_BLINKING(pLed))
				return;
			if (pLed->bLedBlinkInProgress == true) {
			if (pLed->bLedBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedBlinkInProgress = false;
			}
@@ -1264,8 +1260,8 @@ static void SwLedControlMode3(struct _adapter *padapter,
		break;
	case LED_CTL_TX:
	case LED_CTL_RX:
		if ((pLed->bLedBlinkInProgress == false) &&
		    (check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
		if (!pLed->bLedBlinkInProgress &&
		    check_fwstate(pmlmepriv, _FW_LINKED)) {
			if (pLed->CurrLedState == LED_SCAN_BLINK ||
			    IS_LED_WPS_BLINKING(pLed))
				return;
@@ -1298,12 +1294,12 @@ static void SwLedControlMode3(struct _adapter *padapter,
		break;
	case LED_CTL_START_WPS: /* wait until xinpin finish */
	case LED_CTL_START_WPS_BOTTON:
		if (pLed->bLedWPSBlinkInProgress == false) {
			if (pLed->bLedBlinkInProgress == true) {
		if (!pLed->bLedWPSBlinkInProgress) {
			if (pLed->bLedBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedBlinkInProgress = false;
			}
			if (pLed->bLedScanBlinkInProgress == true) {
			if (pLed->bLedScanBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedScanBlinkInProgress = false;
			}
@@ -1395,15 +1391,15 @@ static void SwLedControlMode4(struct _adapter *padapter,
				mod_timer(&pLed->BlinkTimer,
					  jiffies + msecs_to_jiffies(0));
		}
		if (pLed->bLedStartToLinkBlinkInProgress == false) {
		if (!pLed->bLedStartToLinkBlinkInProgress) {
			if (pLed->CurrLedState == LED_SCAN_BLINK ||
			    IS_LED_WPS_BLINKING(pLed))
				return;
			if (pLed->bLedBlinkInProgress == true) {
			if (pLed->bLedBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedBlinkInProgress = false;
			}
			if (pLed->bLedNoLinkBlinkInProgress == true) {
			if (pLed->bLedNoLinkBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedNoLinkBlinkInProgress = false;
			}
@@ -1434,11 +1430,11 @@ static void SwLedControlMode4(struct _adapter *padapter,
						  jiffies + msecs_to_jiffies(0));
			}
		}
		if (pLed->bLedNoLinkBlinkInProgress == false) {
		if (!pLed->bLedNoLinkBlinkInProgress) {
			if (pLed->CurrLedState == LED_SCAN_BLINK ||
			    IS_LED_WPS_BLINKING(pLed))
				return;
			if (pLed->bLedBlinkInProgress == true) {
			if (pLed->bLedBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedBlinkInProgress = false;
			}
@@ -1453,17 +1449,17 @@ static void SwLedControlMode4(struct _adapter *padapter,
		}
		break;
	case LED_CTL_SITE_SURVEY:
		if ((pmlmepriv->sitesurveyctrl.traffic_busy) &&
		    (check_fwstate(pmlmepriv, _FW_LINKED) == true))
		if (pmlmepriv->sitesurveyctrl.traffic_busy &&
		    check_fwstate(pmlmepriv, _FW_LINKED))
			;
		else if (pLed->bLedScanBlinkInProgress == false) {
		else if (!pLed->bLedScanBlinkInProgress) {
			if (IS_LED_WPS_BLINKING(pLed))
				return;
			if (pLed->bLedNoLinkBlinkInProgress == true) {
			if (pLed->bLedNoLinkBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedNoLinkBlinkInProgress = false;
			}
			if (pLed->bLedBlinkInProgress == true) {
			if (pLed->bLedBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedBlinkInProgress = false;
			}
@@ -1480,11 +1476,11 @@ static void SwLedControlMode4(struct _adapter *padapter,
		break;
	case LED_CTL_TX:
	case LED_CTL_RX:
		if (pLed->bLedBlinkInProgress == false) {
		if (!pLed->bLedBlinkInProgress) {
			if (pLed->CurrLedState == LED_SCAN_BLINK ||
			    IS_LED_WPS_BLINKING(pLed))
				return;
			if (pLed->bLedNoLinkBlinkInProgress == true) {
			if (pLed->bLedNoLinkBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedNoLinkBlinkInProgress = false;
			}
@@ -1510,16 +1506,16 @@ static void SwLedControlMode4(struct _adapter *padapter,
				mod_timer(&pLed->BlinkTimer,
					  jiffies + msecs_to_jiffies(0));
		}
		if (pLed->bLedWPSBlinkInProgress == false) {
			if (pLed->bLedNoLinkBlinkInProgress == true) {
		if (!pLed->bLedWPSBlinkInProgress) {
			if (pLed->bLedNoLinkBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedNoLinkBlinkInProgress = false;
			}
			if (pLed->bLedBlinkInProgress == true) {
			if (pLed->bLedBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedBlinkInProgress = false;
			}
			if (pLed->bLedScanBlinkInProgress == true) {
			if (pLed->bLedScanBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedScanBlinkInProgress = false;
			}
@@ -1666,11 +1662,11 @@ static void SwLedControlMode5(struct _adapter *padapter,
			  jiffies + msecs_to_jiffies(0));
		break;
	case LED_CTL_SITE_SURVEY:
		if ((pmlmepriv->sitesurveyctrl.traffic_busy) &&
		    (check_fwstate(pmlmepriv, _FW_LINKED) == true))
		if (pmlmepriv->sitesurveyctrl.traffic_busy &&
		    check_fwstate(pmlmepriv, _FW_LINKED))
			; /* dummy branch */
		else if (pLed->bLedScanBlinkInProgress == false) {
			if (pLed->bLedBlinkInProgress == true) {
		else if (!pLed->bLedScanBlinkInProgress) {
			if (pLed->bLedBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedBlinkInProgress = false;
			}
@@ -1687,7 +1683,7 @@ static void SwLedControlMode5(struct _adapter *padapter,
		break;
	case LED_CTL_TX:
	case LED_CTL_RX:
		if (pLed->bLedBlinkInProgress == false) {
		if (!pLed->bLedBlinkInProgress) {
			if (pLed->CurrLedState == LED_SCAN_BLINK)
				return;
			pLed->bLedBlinkInProgress = true;
@@ -1737,8 +1733,8 @@ static void SwLedControlMode6(struct _adapter *padapter,
		break;
	case LED_CTL_TX:
	case LED_CTL_RX:
		if (pLed->bLedBlinkInProgress == false &&
		   (check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
		if (!pLed->bLedBlinkInProgress &&
		    check_fwstate(pmlmepriv, _FW_LINKED)) {
			if (IS_LED_WPS_BLINKING(pLed))
				return;
			pLed->bLedBlinkInProgress = true;
@@ -1754,8 +1750,8 @@ static void SwLedControlMode6(struct _adapter *padapter,
		break;
	case LED_CTL_START_WPS: /*wait until xinpin finish*/
	case LED_CTL_START_WPS_BOTTON:
		if (pLed->bLedWPSBlinkInProgress == false) {
			if (pLed->bLedBlinkInProgress == true) {
		if (!pLed->bLedWPSBlinkInProgress) {
			if (pLed->bLedBlinkInProgress) {
				del_timer(&pLed->BlinkTimer);
				pLed->bLedBlinkInProgress = false;
			}
@@ -1805,7 +1801,7 @@ void LedControl871x(struct _adapter *padapter, enum LED_CTL_MODE LedAction)
{
	struct led_priv	*ledpriv = &(padapter->ledpriv);

	if (ledpriv->bRegUseLed == false)
	if (!ledpriv->bRegUseLed)
		return;
	switch (ledpriv->LedStrategy) {
	case SW_LED_MODE0:
Loading