Commit 98eb0f53 authored by Inaky Perez-Gonzalez's avatar Inaky Perez-Gonzalez

wimax: fix gcc warnings in sh4 when calling BUG()

SH4's BUG() seems to confuse the compiler as it is considered to
return; thus, some functions would trigger usage of uninitialized
variables or non-void functions returning void.

Work around by initializing/returning.
Signed-off-by: default avatarInaky Perez-Gonzalez <inaky@linux.intel.com>
parent d2f4c105
...@@ -54,8 +54,10 @@ int i2400m_radio_is(struct i2400m *i2400m, enum wimax_rf_state state) ...@@ -54,8 +54,10 @@ int i2400m_radio_is(struct i2400m *i2400m, enum wimax_rf_state state)
/* state == WIMAX_RF_ON */ /* state == WIMAX_RF_ON */
return i2400m->state != I2400M_SS_RF_OFF return i2400m->state != I2400M_SS_RF_OFF
&& i2400m->state != I2400M_SS_RF_SHUTDOWN; && i2400m->state != I2400M_SS_RF_SHUTDOWN;
else else {
BUG(); BUG();
return -EINVAL; /* shut gcc warnings on certain arches */
}
} }
......
...@@ -254,8 +254,10 @@ int i2400mu_bus_reset(struct i2400m *i2400m, enum i2400m_reset_type rt) ...@@ -254,8 +254,10 @@ int i2400mu_bus_reset(struct i2400m *i2400m, enum i2400m_reset_type rt)
dev_err(dev, "USB reset failed (%d), giving up!\n", dev_err(dev, "USB reset failed (%d), giving up!\n",
result); result);
} }
} else } else {
result = -EINVAL; /* shut gcc up in certain arches */
BUG(); BUG();
}
if (result < 0 if (result < 0
&& result != -EINVAL /* device is gone */ && result != -EINVAL /* device is gone */
&& rt != I2400M_RT_BUS) { && rt != I2400M_RT_BUS) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment