net/wireless: ipw2x00: remove unreachable code
authorStanislav Yakovlev <stas.yakovlev@gmail.com>
Thu, 15 Nov 2012 03:07:47 +0000 (03:07 +0000)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 16 Nov 2012 19:29:06 +0000 (14:29 -0500)
Remove unnecessary if statements because libipw_set_geo always
returns success.  Also change function's return value from int
to void.

Signed-off-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ipw2x00/ipw2100.c
drivers/net/wireless/ipw2x00/ipw2200.c
drivers/net/wireless/ipw2x00/libipw.h
drivers/net/wireless/ipw2x00/libipw_geo.c

index 29b8fa1adefde125d62608f3b9513e53afba247a..46938bc9886dcee5bf1c43951d9dc29647da2d26 100644 (file)
@@ -1788,10 +1788,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
        }
 
        /* Initialize the geo */
-       if (libipw_set_geo(priv->ieee, &ipw_geos[0])) {
-               printk(KERN_WARNING DRV_NAME "Could not set geo\n");
-               return 0;
-       }
+       libipw_set_geo(priv->ieee, &ipw_geos[0]);
        priv->ieee->freq_band = LIBIPW_24GHZ_BAND;
 
        lock = LOCK_NONE;
index 768bf612533e04317feb756efa17563400ce6ab2..fea96b58ab898617e9f341575ada3f5e1dcfc3a7 100644 (file)
@@ -11322,10 +11322,7 @@ static int ipw_up(struct ipw_priv *priv)
                                    priv->eeprom[EEPROM_COUNTRY_CODE + 2]);
                        j = 0;
                }
-               if (libipw_set_geo(priv->ieee, &ipw_geos[j])) {
-                       IPW_WARNING("Could not set geography.");
-                       return 0;
-               }
+               libipw_set_geo(priv->ieee, &ipw_geos[j]);
 
                if (priv->status & STATUS_RF_KILL_SW) {
                        IPW_WARNING("Radio disabled by module parameter.\n");
index 0b22fb4217359f72414e2e14726d34d683f422e2..6eede52ad8c0fbc0581a2b3a68d302cb589f4dde 100644 (file)
@@ -978,7 +978,7 @@ extern void libipw_network_reset(struct libipw_network *network);
 /* libipw_geo.c */
 extern const struct libipw_geo *libipw_get_geo(struct libipw_device
                                                     *ieee);
-extern int libipw_set_geo(struct libipw_device *ieee,
+extern void libipw_set_geo(struct libipw_device *ieee,
                             const struct libipw_geo *geo);
 
 extern int libipw_is_valid_channel(struct libipw_device *ieee,
index c9fe3c99cb003c087729b12380b16df014827f8b..218f2a32de21758e105bb4a12e782e65e11ea90a 100644 (file)
@@ -132,7 +132,7 @@ u8 libipw_freq_to_channel(struct libipw_device * ieee, u32 freq)
        return 0;
 }
 
-int libipw_set_geo(struct libipw_device *ieee,
+void libipw_set_geo(struct libipw_device *ieee,
                      const struct libipw_geo *geo)
 {
        memcpy(ieee->geo.name, geo->name, 3);
@@ -143,7 +143,6 @@ int libipw_set_geo(struct libipw_device *ieee,
               sizeof(struct libipw_channel));
        memcpy(ieee->geo.a, geo->a, ieee->geo.a_channels *
               sizeof(struct libipw_channel));
-       return 0;
 }
 
 const struct libipw_geo *libipw_get_geo(struct libipw_device *ieee)