wimax: fix gcc warnings in sh4 when calling BUG()
authorInaky Perez-Gonzalez <inaky@linux.intel.com>
Thu, 11 Jun 2009 18:13:41 +0000 (11:13 -0700)
committerInaky Perez-Gonzalez <inaky@linux.intel.com>
Thu, 11 Jun 2009 18:47:39 +0000 (11:47 -0700)
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: Inaky Perez-Gonzalez <inaky@linux.intel.com>
drivers/net/wimax/i2400m/op-rfkill.c
drivers/net/wimax/i2400m/usb.c

index 487ec58cea46563ccf7c561f2c83fc1890545f21..43927b5d7ad6158a959b06f305e008b56bb306b5 100644 (file)
@@ -54,8 +54,10 @@ int i2400m_radio_is(struct i2400m *i2400m, enum wimax_rf_state state)
                /* state == WIMAX_RF_ON */
                return i2400m->state != I2400M_SS_RF_OFF
                        && i2400m->state != I2400M_SS_RF_SHUTDOWN;
-       else
+       else {
                BUG();
+               return -EINVAL; /* shut gcc warnings on certain arches */
+       }
 }
 
 
index ebc05da8968788e4ce56b36651340c534ebc29ad..cfdaf69da9d1bbc2ed98ca99848d77228c53f52e 100644 (file)
@@ -254,8 +254,10 @@ do_bus_reset:
                        dev_err(dev, "USB reset failed (%d), giving up!\n",
                                result);
                }
-       } else
+       } else {
+               result = -EINVAL;       /* shut gcc up in certain arches */
                BUG();
+       }
        if (result < 0
            && result != -EINVAL        /* device is gone */
            && rt != I2400M_RT_BUS) {