Commit 12f32370 authored by Peter Senna Tschudin's avatar Peter Senna Tschudin Committed by John W. Linville

net: wireless: Remove useless return variables

This patch remove variables that are initialized with a constant,
are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.

wl_cfg80211.c verified by compilation only.
phy/phy_cmn.c unverified.

The coccinelle script that find and fixes this issue is:
// <smpl>
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
    when strict
return
- ret
+ C
;
// </smpl>
Signed-off-by: default avatarPeter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 7171511e
...@@ -1331,7 +1331,6 @@ static s32 ...@@ -1331,7 +1331,6 @@ static s32
brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *ndev) brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *ndev)
{ {
struct brcmf_if *ifp = netdev_priv(ndev); struct brcmf_if *ifp = netdev_priv(ndev);
s32 err = 0;
brcmf_dbg(TRACE, "Enter\n"); brcmf_dbg(TRACE, "Enter\n");
if (!check_vif_up(ifp->vif)) if (!check_vif_up(ifp->vif))
...@@ -1341,7 +1340,7 @@ brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *ndev) ...@@ -1341,7 +1340,7 @@ brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *ndev)
brcmf_dbg(TRACE, "Exit\n"); brcmf_dbg(TRACE, "Exit\n");
return err; return 0;
} }
static s32 brcmf_set_wpa_version(struct net_device *ndev, static s32 brcmf_set_wpa_version(struct net_device *ndev,
...@@ -2388,7 +2387,6 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_info *cfg, ...@@ -2388,7 +2387,6 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_info *cfg,
struct cfg80211_bss *bss; struct cfg80211_bss *bss;
struct ieee80211_supported_band *band; struct ieee80211_supported_band *band;
struct brcmu_chan ch; struct brcmu_chan ch;
s32 err = 0;
u16 channel; u16 channel;
u32 freq; u32 freq;
u16 notify_capability; u16 notify_capability;
...@@ -2438,7 +2436,7 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_info *cfg, ...@@ -2438,7 +2436,7 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_info *cfg,
cfg80211_put_bss(wiphy, bss); cfg80211_put_bss(wiphy, bss);
return err; return 0;
} }
static struct brcmf_bss_info_le * static struct brcmf_bss_info_le *
...@@ -2690,7 +2688,6 @@ brcmf_cfg80211_escan_handler(struct brcmf_if *ifp, ...@@ -2690,7 +2688,6 @@ brcmf_cfg80211_escan_handler(struct brcmf_if *ifp,
{ {
struct brcmf_cfg80211_info *cfg = ifp->drvr->config; struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
s32 status; s32 status;
s32 err = 0;
struct brcmf_escan_result_le *escan_result_le; struct brcmf_escan_result_le *escan_result_le;
struct brcmf_bss_info_le *bss_info_le; struct brcmf_bss_info_le *bss_info_le;
struct brcmf_bss_info_le *bss = NULL; struct brcmf_bss_info_le *bss = NULL;
...@@ -2781,7 +2778,7 @@ brcmf_cfg80211_escan_handler(struct brcmf_if *ifp, ...@@ -2781,7 +2778,7 @@ brcmf_cfg80211_escan_handler(struct brcmf_if *ifp,
status); status);
} }
exit: exit:
return err; return 0;
} }
static void brcmf_init_escan(struct brcmf_cfg80211_info *cfg) static void brcmf_init_escan(struct brcmf_cfg80211_info *cfg)
...@@ -3507,7 +3504,6 @@ static s32 ...@@ -3507,7 +3504,6 @@ static s32
brcmf_parse_vndr_ies(const u8 *vndr_ie_buf, u32 vndr_ie_len, brcmf_parse_vndr_ies(const u8 *vndr_ie_buf, u32 vndr_ie_len,
struct parsed_vndr_ies *vndr_ies) struct parsed_vndr_ies *vndr_ies)
{ {
s32 err = 0;
struct brcmf_vs_tlv *vndrie; struct brcmf_vs_tlv *vndrie;
struct brcmf_tlv *ie; struct brcmf_tlv *ie;
struct parsed_vndr_ie_info *parsed_info; struct parsed_vndr_ie_info *parsed_info;
...@@ -3560,7 +3556,7 @@ brcmf_parse_vndr_ies(const u8 *vndr_ie_buf, u32 vndr_ie_len, ...@@ -3560,7 +3556,7 @@ brcmf_parse_vndr_ies(const u8 *vndr_ie_buf, u32 vndr_ie_len,
ie = (struct brcmf_tlv *)(((u8 *)ie) + ie->len + ie = (struct brcmf_tlv *)(((u8 *)ie) + ie->len +
TLV_HDR_LEN); TLV_HDR_LEN);
} }
return err; return 0;
} }
static u32 static u32
...@@ -4650,7 +4646,6 @@ brcmf_bss_connect_done(struct brcmf_cfg80211_info *cfg, ...@@ -4650,7 +4646,6 @@ brcmf_bss_connect_done(struct brcmf_cfg80211_info *cfg,
struct brcmf_if *ifp = netdev_priv(ndev); struct brcmf_if *ifp = netdev_priv(ndev);
struct brcmf_cfg80211_profile *profile = &ifp->vif->profile; struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg); struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg);
s32 err = 0;
brcmf_dbg(TRACE, "Enter\n"); brcmf_dbg(TRACE, "Enter\n");
...@@ -4676,7 +4671,7 @@ brcmf_bss_connect_done(struct brcmf_cfg80211_info *cfg, ...@@ -4676,7 +4671,7 @@ brcmf_bss_connect_done(struct brcmf_cfg80211_info *cfg,
completed ? "succeeded" : "failed"); completed ? "succeeded" : "failed");
} }
brcmf_dbg(TRACE, "Exit\n"); brcmf_dbg(TRACE, "Exit\n");
return err; return 0;
} }
static s32 static s32
...@@ -4768,7 +4763,6 @@ brcmf_notify_roaming_status(struct brcmf_if *ifp, ...@@ -4768,7 +4763,6 @@ brcmf_notify_roaming_status(struct brcmf_if *ifp,
const struct brcmf_event_msg *e, void *data) const struct brcmf_event_msg *e, void *data)
{ {
struct brcmf_cfg80211_info *cfg = ifp->drvr->config; struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
s32 err = 0;
u32 event = e->event_code; u32 event = e->event_code;
u32 status = e->status; u32 status = e->status;
...@@ -4779,7 +4773,7 @@ brcmf_notify_roaming_status(struct brcmf_if *ifp, ...@@ -4779,7 +4773,7 @@ brcmf_notify_roaming_status(struct brcmf_if *ifp,
brcmf_bss_connect_done(cfg, ifp->ndev, e, true); brcmf_bss_connect_done(cfg, ifp->ndev, e, true);
} }
return err; return 0;
} }
static s32 static s32
......
...@@ -1538,11 +1538,7 @@ static s8 ...@@ -1538,11 +1538,7 @@ static s8
wlc_user_txpwr_antport_to_rfport(struct brcms_phy *pi, uint chan, u32 band, wlc_user_txpwr_antport_to_rfport(struct brcms_phy *pi, uint chan, u32 band,
u8 rate) u8 rate)
{ {
s8 offset = 0; return 0;
if (!pi->user_txpwr_at_rfport)
return offset;
return offset;
} }
void wlc_phy_txpower_recalc_target(struct brcms_phy *pi) void wlc_phy_txpower_recalc_target(struct brcms_phy *pi)
......
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