staging: ks7010: add explicit check to 'size' variables

When checking the value of a variable that holds a 0 an explicit check
is good style. i.e

  -    if (!size)
  +    if (size == 0)

Update checks on 'numerical' variables to use explicit checks.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Tobin C. Harding 2017-03-22 11:59:54 +11:00 committed by Greg Kroah-Hartman
parent b5ca039ac1
commit 310e916f54
3 changed files with 6 additions and 6 deletions

View File

@ -591,7 +591,7 @@ static void ks_sdio_interrupt(struct sdio_func *func)
}
DPRINTK(4, "WSTATUS_RSIZE=%02X\n", rw_data);
rsize = rw_data & RSIZE_MASK;
if (rsize) { /* Read schedule */
if (rsize != 0) { /* Read schedule */
ks_wlan_hw_rx((void *)priv,
(uint16_t)(rsize << 4));
}
@ -829,7 +829,7 @@ static void ks7010_card_init(struct ks_wlan_private *priv)
DPRINTK(1, "wait time out!! SME_START\n");
}
if (priv->mac_address_valid && priv->version_size)
if (priv->mac_address_valid && priv->version_size != 0)
priv->dev_state = DEVICE_STATE_PREINIT;
hostif_sme_enqueue(priv, SME_GET_EEPROM_CKSUM);

View File

@ -129,7 +129,7 @@ int get_current_ap(struct ks_wlan_private *priv, struct link_ap_info_t *ap_info)
memcpy(ap->rate_set.body, ap_info->rate_set.body,
ap_info->rate_set.size);
ap->rate_set.size = ap_info->rate_set.size;
if (ap_info->ext_rate_set.size) {
if (ap_info->ext_rate_set.size != 0) {
/* rate_set */
memcpy(&ap->rate_set.body[ap->rate_set.size],
ap_info->ext_rate_set.body,

View File

@ -335,7 +335,7 @@ static int ks_wlan_get_essid(struct net_device *dev,
/* Note : if dwrq->flags != 0, we should
* get the relevant SSID from the SSID list...
*/
if (priv->reg.ssid.size) {
if (priv->reg.ssid.size != 0) {
/* Get the current SSID */
memcpy(extra, priv->reg.ssid.body, priv->reg.ssid.size);
@ -928,7 +928,7 @@ static int ks_wlan_set_encode(struct net_device *dev,
/* Do we want to just set the transmit key index ? */
if ((index >= 0) && (index < 4)) {
/* set_wep_key(priv, index, 0, 0, 1); xxx */
if (priv->reg.wep_key[index].size) {
if (priv->reg.wep_key[index].size != 0) {
priv->reg.wep_index = index;
priv->need_commit |= SME_WEP_INDEX;
} else {
@ -1531,7 +1531,7 @@ static int ks_wlan_get_scan(struct net_device *dev,
return -EAGAIN;
}
if (!priv->aplist.size) {
if (priv->aplist.size == 0) {
/* Client error, no scan results...
* The caller need to restart the scan.
*/