mwifiex: remove unnecessary variable initialization
Skip initialization of local variables with some default values
if the values are not going to be used further down the code path.
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index fc2c0c5..27ad72b 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -151,7 +151,7 @@
*/
static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter)
{
- int ret = 0;
+ int ret;
u32 buf_size;
struct mwifiex_bssdescriptor *temp_scan_table;
@@ -342,9 +342,8 @@
*/
int mwifiex_init_lock_list(struct mwifiex_adapter *adapter)
{
- struct mwifiex_private *priv = NULL;
- s32 i = 0;
- u32 j = 0;
+ struct mwifiex_private *priv;
+ s32 i, j;
spin_lock_init(&adapter->mwifiex_lock);
spin_lock_init(&adapter->int_lock);
@@ -400,9 +399,8 @@
*/
void mwifiex_free_lock_list(struct mwifiex_adapter *adapter)
{
- struct mwifiex_private *priv = NULL;
- s32 i = 0;
- s32 j = 0;
+ struct mwifiex_private *priv;
+ s32 i, j;
/* Free lists */
list_del(&adapter->cmd_free_q);
@@ -436,10 +434,9 @@
*/
int mwifiex_init_fw(struct mwifiex_adapter *adapter)
{
- int ret = 0;
- struct mwifiex_private *priv = NULL;
- u8 i = 0;
- u8 first_sta = true;
+ int ret;
+ struct mwifiex_private *priv;
+ u8 i, first_sta = true;
int is_cmd_pend_q_empty;
unsigned long flags;
@@ -497,8 +494,7 @@
{
int i;
struct mwifiex_adapter *adapter = priv->adapter;
- struct mwifiex_bss_prio_node *bssprio_node = NULL, *tmp_node = NULL,
- **cur = NULL;
+ struct mwifiex_bss_prio_node *bssprio_node, *tmp_node, **cur;
struct list_head *head;
spinlock_t *lock;
unsigned long flags;
@@ -552,8 +548,8 @@
mwifiex_shutdown_drv(struct mwifiex_adapter *adapter)
{
int ret = -EINPROGRESS;
- struct mwifiex_private *priv = NULL;
- s32 i = 0;
+ struct mwifiex_private *priv;
+ s32 i;
unsigned long flags;
/* mwifiex already shutdown */
@@ -608,9 +604,8 @@
int mwifiex_dnld_fw(struct mwifiex_adapter *adapter,
struct mwifiex_fw_image *pmfw)
{
- int ret = 0;
+ int ret, winner;
u32 poll_num = 1;
- int winner;
/* Check if firmware is already running */
ret = adapter->if_ops.check_fw_status(adapter, poll_num, &winner);