Skip to content

Commit

Permalink
net/wireless: ipw2x00: remove unreachable code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stanislav Yakovlev authored and John W. Linville committed Nov 16, 2012
1 parent b87e2c4 commit 9c033be
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
5 changes: 1 addition & 4 deletions drivers/net/wireless/ipw2x00/ipw2100.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 1 addition & 4 deletions drivers/net/wireless/ipw2x00/ipw2200.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ipw2x00/libipw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/wireless/ipw2x00/libipw_geo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
Expand Down

0 comments on commit 9c033be

Please sign in to comment.