From 310e916f54579b2d9a33fd6501cc46acc2d4dc70 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 22 Mar 2017 11:59:54 +1100 Subject: [PATCH] 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ks7010/ks7010_sdio.c | 4 ++-- drivers/staging/ks7010/ks_hostif.c | 2 +- drivers/staging/ks7010/ks_wlan_net.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index dbb1f0538b48..882998959829 100644 --- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers/staging/ks7010/ks7010_sdio.c @@ -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); diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index dc730a3c98c2..24feee3ffa54 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -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, diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c index c097ecd576db..5e686996e1ce 100644 --- a/drivers/staging/ks7010/ks_wlan_net.c +++ b/drivers/staging/ks7010/ks_wlan_net.c @@ -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. */ -- 2.30.2