mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
Staging: wilc1000: Compress return logic into one line
Simplify function returns by merging assignment and return into one command line. Delete unnecesarry return variable. Found with Coccinelle @@ expression e, ret; @@ -ret = +return e; -return ret Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1cbe7adb9c
commit
3b438f2ca9
2 changed files with 6 additions and 16 deletions
|
@ -224,9 +224,7 @@ static inline u16 get_asoc_status(u8 *data)
|
||||||
u16 asoc_status;
|
u16 asoc_status;
|
||||||
|
|
||||||
asoc_status = data[3];
|
asoc_status = data[3];
|
||||||
asoc_status = (asoc_status << 8) | data[2];
|
return (asoc_status << 8) | data[2];
|
||||||
|
|
||||||
return asoc_status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline u16 get_asoc_id(u8 *data)
|
static inline u16 get_asoc_id(u8 *data)
|
||||||
|
|
|
@ -1591,28 +1591,25 @@ static int remain_on_channel(struct wiphy *wiphy,
|
||||||
priv->strRemainOnChanParams.u32ListenDuration = duration;
|
priv->strRemainOnChanParams.u32ListenDuration = duration;
|
||||||
priv->strRemainOnChanParams.u32ListenSessionID++;
|
priv->strRemainOnChanParams.u32ListenSessionID++;
|
||||||
|
|
||||||
s32Error = wilc_remain_on_channel(vif,
|
return wilc_remain_on_channel(vif,
|
||||||
priv->strRemainOnChanParams.u32ListenSessionID,
|
priv->strRemainOnChanParams.u32ListenSessionID,
|
||||||
duration, chan->hw_value,
|
duration, chan->hw_value,
|
||||||
WILC_WFI_RemainOnChannelExpired,
|
WILC_WFI_RemainOnChannelExpired,
|
||||||
WILC_WFI_RemainOnChannelReady, (void *)priv);
|
WILC_WFI_RemainOnChannelReady, (void *)priv);
|
||||||
|
|
||||||
return s32Error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cancel_remain_on_channel(struct wiphy *wiphy,
|
static int cancel_remain_on_channel(struct wiphy *wiphy,
|
||||||
struct wireless_dev *wdev,
|
struct wireless_dev *wdev,
|
||||||
u64 cookie)
|
u64 cookie)
|
||||||
{
|
{
|
||||||
s32 s32Error = 0;
|
|
||||||
struct wilc_priv *priv;
|
struct wilc_priv *priv;
|
||||||
struct wilc_vif *vif;
|
struct wilc_vif *vif;
|
||||||
|
|
||||||
priv = wiphy_priv(wiphy);
|
priv = wiphy_priv(wiphy);
|
||||||
vif = netdev_priv(priv->dev);
|
vif = netdev_priv(priv->dev);
|
||||||
|
|
||||||
s32Error = wilc_listen_state_expired(vif, priv->strRemainOnChanParams.u32ListenSessionID);
|
return wilc_listen_state_expired(vif,
|
||||||
return s32Error;
|
priv->strRemainOnChanParams.u32ListenSessionID);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mgmt_tx(struct wiphy *wiphy,
|
static int mgmt_tx(struct wiphy *wiphy,
|
||||||
|
@ -1936,12 +1933,10 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev,
|
||||||
wilc_wlan_set_bssid(dev, wl->vif[vif->idx]->src_addr, AP_MODE);
|
wilc_wlan_set_bssid(dev, wl->vif[vif->idx]->src_addr, AP_MODE);
|
||||||
wilc_set_power_mgmt(vif, 0, 0);
|
wilc_set_power_mgmt(vif, 0, 0);
|
||||||
|
|
||||||
s32Error = wilc_add_beacon(vif, settings->beacon_interval,
|
return wilc_add_beacon(vif, settings->beacon_interval,
|
||||||
settings->dtim_period, beacon->head_len,
|
settings->dtim_period, beacon->head_len,
|
||||||
(u8 *)beacon->head, beacon->tail_len,
|
(u8 *)beacon->head, beacon->tail_len,
|
||||||
(u8 *)beacon->tail);
|
(u8 *)beacon->tail);
|
||||||
|
|
||||||
return s32Error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int change_beacon(struct wiphy *wiphy, struct net_device *dev,
|
static int change_beacon(struct wiphy *wiphy, struct net_device *dev,
|
||||||
|
@ -1949,16 +1944,13 @@ static int change_beacon(struct wiphy *wiphy, struct net_device *dev,
|
||||||
{
|
{
|
||||||
struct wilc_priv *priv;
|
struct wilc_priv *priv;
|
||||||
struct wilc_vif *vif;
|
struct wilc_vif *vif;
|
||||||
s32 s32Error = 0;
|
|
||||||
|
|
||||||
priv = wiphy_priv(wiphy);
|
priv = wiphy_priv(wiphy);
|
||||||
vif = netdev_priv(priv->dev);
|
vif = netdev_priv(priv->dev);
|
||||||
|
|
||||||
s32Error = wilc_add_beacon(vif, 0, 0, beacon->head_len,
|
return wilc_add_beacon(vif, 0, 0, beacon->head_len,
|
||||||
(u8 *)beacon->head, beacon->tail_len,
|
(u8 *)beacon->head, beacon->tail_len,
|
||||||
(u8 *)beacon->tail);
|
(u8 *)beacon->tail);
|
||||||
|
|
||||||
return s32Error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int stop_ap(struct wiphy *wiphy, struct net_device *dev)
|
static int stop_ap(struct wiphy *wiphy, struct net_device *dev)
|
||||||
|
|
Loading…
Add table
Reference in a new issue