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

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
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
This diff is collapsed.
......@@ -217,7 +217,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter,
curfragnum++;
plist = &defrag_q->queue;
plist = plist->next;
while (end_of_queue_search(phead, plist) == false) {
while (!end_of_queue_search(phead, plist)) {
pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u);
pnfhdr = &pnextrframe->u.hdr;
/*check the fragment sequence (2nd ~n fragment frame) */
......@@ -489,7 +489,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl,
phead = &ppending_recvframe_queue->queue;
plist = phead->next;
while (end_of_queue_search(phead, plist) == false) {
while (!end_of_queue_search(phead, plist)) {
pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u);
pnextattrib = &pnextrframe->u.hdr.attrib;
if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num))
......@@ -519,7 +519,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter,
phead = &ppending_recvframe_queue->queue;
plist = phead->next;
/* Handling some condition for forced indicate case.*/
if (bforced == true) {
if (bforced) {
if (list_empty(phead))
return true;
......@@ -541,8 +541,8 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter,
(preorder_ctrl->indicate_seq + 1) % 4096;
/*indicate this recv_frame*/
if (!pattrib->amsdu) {
if ((padapter->bDriverStopped == false) &&
(padapter->bSurpriseRemoved == false)) {
if (!padapter->bDriverStopped &&
!padapter->bSurpriseRemoved) {
/* indicate this recv_frame */
r8712_recv_indicatepkt(padapter,
prframe);
......@@ -576,8 +576,8 @@ static int recv_indicatepkt_reorder(struct _adapter *padapter,
/* s1. */
r8712_wlanhdr_to_ethhdr(prframe);
if (pattrib->qos != 1) {
if ((padapter->bDriverStopped == false) &&
(padapter->bSurpriseRemoved == false)) {
if (!padapter->bDriverStopped &&
!padapter->bSurpriseRemoved) {
r8712_recv_indicatepkt(padapter, prframe);
return _SUCCESS;
} else
......@@ -643,16 +643,15 @@ static int r8712_process_recv_indicatepkts(struct _adapter *padapter,
if (phtpriv->ht_option == 1) { /*B/G/N Mode*/
if (recv_indicatepkt_reorder(padapter, prframe) != _SUCCESS) {
/* including perform A-MPDU Rx Ordering Buffer Control*/
if ((padapter->bDriverStopped == false) &&
(padapter->bSurpriseRemoved == false))
if (!padapter->bDriverStopped &&
!padapter->bSurpriseRemoved)
return _FAIL;
}
} else { /*B/G mode*/
retval = r8712_wlanhdr_to_ethhdr(prframe);
if (retval != _SUCCESS)
return retval;
if ((padapter->bDriverStopped == false) &&
(padapter->bSurpriseRemoved == false)) {
if (!padapter->bDriverStopped && !padapter->bSurpriseRemoved) {
/* indicate this recv_frame */
r8712_recv_indicatepkt(padapter, prframe);
} else
......@@ -962,12 +961,12 @@ int recv_func(struct _adapter *padapter, void *pcontext)
prframe = (union recv_frame *)pcontext;
orig_prframe = prframe;
pattrib = &prframe->u.hdr.attrib;
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) {
if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
if (pattrib->crc_err == 1)
padapter->mppriv.rx_crcerrpktcount++;
else
padapter->mppriv.rx_pktcount++;
if (check_fwstate(pmlmepriv, WIFI_MP_LPBK_STATE) == false) {
if (!check_fwstate(pmlmepriv, WIFI_MP_LPBK_STATE)) {
/* free this recv_frame */
r8712_free_recvframe(orig_prframe, pfree_recv_queue);
goto _exit_recv_func;
......
......@@ -168,7 +168,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv,
xmitframe_phead = &pframe_queue->queue;
xmitframe_plist = xmitframe_phead->next;
if ((end_of_queue_search(xmitframe_phead, xmitframe_plist)) == false) {
if (!end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
pxmitframe = LIST_CONTAINOR(xmitframe_plist,
struct xmit_frame, list);
list_del_init(&pxmitframe->list);
......@@ -208,7 +208,7 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv,
phwxmit = phwxmit_i + inx[i];
sta_phead = &phwxmit->sta_queue->queue;
sta_plist = sta_phead->next;
while ((end_of_queue_search(sta_phead, sta_plist)) == false) {
while (!end_of_queue_search(sta_phead, sta_plist)) {
ptxservq = LIST_CONTAINOR(sta_plist, struct tx_servq,
tx_pending);
pframe_queue = &ptxservq->sta_pending;
......
......@@ -172,7 +172,7 @@ u32 r8712_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *obj)
{
int res;
if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag == true)
if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag)
return _FAIL;
res = _enqueue_cmd(&pcmdpriv->cmd_queue, obj);
up(&pcmdpriv->cmd_queue_sema);
......@@ -186,7 +186,7 @@ u32 r8712_enqueue_cmd_ex(struct cmd_priv *pcmdpriv, struct cmd_obj *obj)
if (obj == NULL)
return _SUCCESS;
if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag == true)
if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag)
return _FAIL;
queue = &pcmdpriv->cmd_queue;
spin_lock_irqsave(&queue->lock, irqL);
......@@ -519,7 +519,7 @@ u8 r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork)
* If not, we copy the connecting AP's MAC address to it so that
* the driver just has the bssid information for PMKIDList searching.
*/
if (pmlmepriv->assoc_by_bssid == false)
if (!pmlmepriv->assoc_by_bssid)
ether_addr_copy(&pmlmepriv->assoc_bssid[0],
&pnetwork->network.MacAddress[0]);
psecnetwork->IELength = r8712_restruct_sec_ie(padapter,
......@@ -679,7 +679,7 @@ u8 r8712_setstakey_cmd(struct _adapter *padapter, u8 *psta, u8 unicast_key)
else
GET_ENCRY_ALGO(psecuritypriv, sta,
psetstakey_para->algorithm, false);
if (unicast_key == true)
if (unicast_key)
memcpy(&psetstakey_para->key, &sta->x_UncstKey, 16);
else
memcpy(&psetstakey_para->key,
......
......@@ -49,7 +49,7 @@ static void shift_out_bits(struct _adapter *padapter, u16 data, u16 count)
{
u16 x, mask;
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
goto out;
mask = 0x01 << (count - 1);
x = r8712_read8(padapter, EE_9346CR);
......@@ -58,7 +58,7 @@ static void shift_out_bits(struct _adapter *padapter, u16 data, u16 count)
x &= ~_EEDI;
if (data & mask)
x |= _EEDI;
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
goto out;
r8712_write8(padapter, EE_9346CR, (u8)x);
udelay(CLOCK_RATE);
......@@ -66,7 +66,7 @@ static void shift_out_bits(struct _adapter *padapter, u16 data, u16 count)
down_clk(padapter, &x);
mask >>= 1;
} while (mask);
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
goto out;
x &= ~_EEDI;
r8712_write8(padapter, EE_9346CR, (u8)x);
......@@ -77,7 +77,7 @@ static u16 shift_in_bits(struct _adapter *padapter)
{
u16 x, d = 0, i;
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
goto out;
x = r8712_read8(padapter, EE_9346CR);
x &= ~(_EEDO | _EEDI);
......@@ -85,7 +85,7 @@ static u16 shift_in_bits(struct _adapter *padapter)
for (i = 0; i < 16; i++) {
d <<= 1;
up_clk(padapter, &x);
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
goto out;
x = r8712_read8(padapter, EE_9346CR);
x &= ~(_EEDI);
......@@ -129,17 +129,17 @@ static void eeprom_clean(struct _adapter *padapter)
{
u16 x;
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
return;
x = r8712_read8(padapter, EE_9346CR);
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
return;
x &= ~(_EECS | _EEDI);
r8712_write8(padapter, EE_9346CR, (u8)x);
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
return;
up_clk(padapter, &x);
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
return;
down_clk(padapter, &x);
}
......@@ -206,11 +206,11 @@ u16 r8712_eeprom_read16(struct _adapter *padapter, u16 reg) /*ReadEEprom*/
tmp8_clk_new = tmp8_clk_ori | 0x20;
if (tmp8_clk_new != tmp8_clk_ori)
r8712_write8(padapter, 0x10250003, tmp8_clk_new);
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
goto out;
/* select EEPROM, reset bits, set _EECS */
x = r8712_read8(padapter, EE_9346CR);
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
goto out;
x &= ~(_EEDI | _EEDO | _EESK | _EEM0);
x |= _EEM1 | _EECS;
......
......@@ -178,17 +178,17 @@ static inline char *translate_scan(struct _adapter *padapter,
/* Add the protocol name */
iwe.cmd = SIOCGIWNAME;
if (r8712_is_cckratesonly_included(pnetwork->network.rates)) {
if (ht_cap == true)
if (ht_cap)
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bn");
else
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11b");
} else if (r8712_is_cckrates_included(pnetwork->network.rates)) {
if (ht_cap == true)
if (ht_cap)
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bgn");
else
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bg");
} else {
if (ht_cap == true)
if (ht_cap)
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11gn");
else
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11g");
......@@ -310,7 +310,7 @@ static inline char *translate_scan(struct _adapter *padapter,
if (r8712_get_wps_ie(pnetwork->network.IEs,
pnetwork->network.IELength,
wps_ie, &wps_ielen) == true) {
wps_ie, &wps_ielen)) {
if (wps_ielen > 2) {
iwe.cmd = IWEVGENIE;
iwe.u.data.length = (u16)wps_ielen;
......@@ -443,7 +443,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
struct sta_priv *pstapriv = &padapter->stapriv;
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE |
WIFI_MP_STATE) == true) { /* sta mode */
WIFI_MP_STATE)) { /* sta mode */
psta = r8712_get_stainfo(pstapriv,
get_bssid(pmlmepriv));
if (psta) {
......@@ -617,22 +617,22 @@ static int r8711_wx_get_name(struct net_device *dev,
if (p && ht_ielen > 0)
ht_cap = true;
prates = pcur_bss->rates;
if (r8712_is_cckratesonly_included(prates) == true) {
if (ht_cap == true)
if (r8712_is_cckratesonly_included(prates)) {
if (ht_cap)
snprintf(wrqu->name, IFNAMSIZ,
"IEEE 802.11bn");
else
snprintf(wrqu->name, IFNAMSIZ,
"IEEE 802.11b");
} else if ((r8712_is_cckrates_included(prates)) == true) {
if (ht_cap == true)
} else if (r8712_is_cckrates_included(prates)) {
if (ht_cap)
snprintf(wrqu->name, IFNAMSIZ,
"IEEE 802.11bgn");
else
snprintf(wrqu->name, IFNAMSIZ,
"IEEE 802.11bg");
} else {
if (ht_cap == true)
if (ht_cap)
snprintf(wrqu->name, IFNAMSIZ,
"IEEE 802.11gn");
else
......@@ -697,7 +697,7 @@ static int r8711_wx_get_freq(struct net_device *dev,
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
wrqu->freq.m = ieee80211_wlan_frequencies[
pcur_bss->Configuration.DSConfig-1] * 100000;
wrqu->freq.e = 1;
......@@ -746,12 +746,12 @@ static int r8711_wx_get_mode(struct net_device *dev, struct iw_request_info *a,
struct _adapter *padapter = netdev_priv(dev);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
wrqu->mode = IW_MODE_INFRA;
else if (check_fwstate(pmlmepriv,
WIFI_ADHOC_MASTER_STATE|WIFI_ADHOC_STATE) == true)
WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE))
wrqu->mode = IW_MODE_ADHOC;
else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
else if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
wrqu->mode = IW_MODE_MASTER;
else
wrqu->mode = IW_MODE_AUTO;
......@@ -940,7 +940,7 @@ static int r871x_wx_set_priv(struct net_device *dev,
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct wlan_network *pcur_network = &pmlmepriv->cur_network;
/*static u8 xxxx; */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
sprintf(ext, "%s rssi %d",
pcur_network->network.Ssid.Ssid,
/*(xxxx=xxxx+10) */
......@@ -1044,9 +1044,9 @@ static int r8711_wx_set_wap(struct net_device *dev,
struct wlan_network *pnetwork = NULL;
enum NDIS_802_11_AUTHENTICATION_MODE authmode;
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true)
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
return -EBUSY;
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
return ret;
if (temp->sa_family != ARPHRD_ETHER)
return -EINVAL;
......@@ -1055,7 +1055,7 @@ static int r8711_wx_set_wap(struct net_device *dev,
phead = &queue->queue;
pmlmepriv->pscanned = phead->next;
while (1) {
if (end_of_queue_search(phead, pmlmepriv->pscanned) == true)
if (end_of_queue_search(phead, pmlmepriv->pscanned))
break;
pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned,
struct wlan_network, list);
......@@ -1137,17 +1137,17 @@ static int r8711_wx_set_scan(struct net_device *dev,
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
u8 status = true;
if (padapter->bDriverStopped == true) {
if (padapter->bDriverStopped) {
netdev_info(dev, "In %s: bDriverStopped=%d\n",
__func__, padapter->bDriverStopped);
return -1;
}
if (padapter->bup == false)
if (!padapter->bup)
return -ENETDOWN;
if (padapter->hw_init_completed == false)
if (!padapter->hw_init_completed)
return -1;
if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING)) ||
(pmlmepriv->sitesurveyctrl.traffic_busy == true))
(pmlmepriv->sitesurveyctrl.traffic_busy))
return 0;
if (wrqu->data.length == sizeof(struct iw_scan_req)) {
struct iw_scan_req *req = (struct iw_scan_req *)extra;
......@@ -1164,7 +1164,7 @@ static int r8711_wx_set_scan(struct net_device *dev,
spin_lock_irqsave(&pmlmepriv->lock, irqL);
if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY |
_FW_UNDER_LINKING)) ||
(pmlmepriv->sitesurveyctrl.traffic_busy == true)) {
(pmlmepriv->sitesurveyctrl.traffic_busy)) {
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
status = false;
} else
......@@ -1173,7 +1173,7 @@ static int r8711_wx_set_scan(struct net_device *dev,
}
} else
status = r8712_set_802_11_bssid_list_scan(padapter);
if (status == false)
if (!status)
return -1;
return 0;
}
......@@ -1204,7 +1204,7 @@ static int r8711_wx_get_scan(struct net_device *dev,
phead = &queue->queue;
plist = phead->next;
while (1) {
if (end_of_queue_search(phead, plist) == true)
if (end_of_queue_search(phead, plist))
break;
if ((stop - ev) < SCAN_ITEM_SIZE) {
ret = -E2BIG;
......@@ -1427,7 +1427,7 @@ static int r8711_wx_get_rate(struct net_device *dev,
wrqu->bitrate.value = rate*500000;
i++;
}
if (ht_cap == true) {
if (ht_cap) {
if (mcs_rate & 0x8000 /* MCS15 */
&&
rf_type == RTL8712_RF_2T2R)
......@@ -1599,7 +1599,7 @@ static int r8711_wx_get_enc(struct net_device *dev,
struct iw_point *erq = &(wrqu->encoding);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
if (check_fwstate(pmlmepriv, _FW_LINKED) == false) {
if (!check_fwstate(pmlmepriv, _FW_LINKED)) {
if (!check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
erq->length = 0;
erq->flags |= IW_ENCODE_DISABLED;
......@@ -1973,7 +1973,7 @@ static int r871x_get_ap_info(struct net_device *dev,
phead = &queue->queue;
plist = phead->next;
while (1) {
if (end_of_queue_search(phead, plist) == true)
if (end_of_queue_search(phead, plist))
break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
if (!mac_pton(data, bssid)) {
......
......@@ -324,8 +324,8 @@ uint oid_rt_get_channel_hdl(struct oid_par_priv *poid_par_priv)
if (poid_par_priv->type_of_oid != QUERY_OID)
return RNDIS_STATUS_NOT_ACCEPTED;
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true))
if (check_fwstate(pmlmepriv, _FW_LINKED) ||
check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))
pnic_Config = &pmlmepriv->cur_network.network.Configuration;
else
pnic_Config = &padapter->registrypriv.dev_network.
......@@ -465,7 +465,7 @@ uint oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv *poid_par_priv)
if (poid_par_priv->type_of_oid != SET_OID) /* QUERY_OID */
return RNDIS_STATUS_NOT_ACCEPTED;
if (poid_par_priv->information_buf_len == (sizeof(unsigned long)*3)) {
if (Adapter->mppriv.act_in_progress == true)
if (Adapter->mppriv.act_in_progress)
status = RNDIS_STATUS_NOT_ACCEPTED;
else {
/* init workparam */
......@@ -515,11 +515,11 @@ uint oid_rt_get_connect_state_hdl(struct oid_par_priv *poid_par_priv)
* nStatus==2 AdHocMode
* nStatus==3 NotAssociated
*/
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
ulInfo = CHECKINGSTATUS;
else if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
else if (check_fwstate(pmlmepriv, _FW_LINKED))
ulInfo = ASSOCIATED;
else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)
else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))
ulInfo = ADHOCMODE;
else
ulInfo = NOTASSOCIATED;
......
......@@ -136,12 +136,12 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid)
}
spin_lock_irqsave(&pmlmepriv->lock, irqL);