Commit d241877a authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: avoid setting default value for variable at declaration

Cleanup patch to avoid setting default value for local variables and
also clubbed similar variables together.
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Reviewed-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 448d0784
......@@ -123,9 +123,7 @@ static inline void get_BSSID(u8 *data, u8 *bssid)
static inline void get_ssid(u8 *data, u8 *ssid, u8 *p_ssid_len)
{
u8 len = 0;
u8 i = 0;
u8 j = 0;
u8 i, j, len;
len = data[TAG_PARAM_OFFSET + 1];
j = TAG_PARAM_OFFSET + 2;
......@@ -198,18 +196,11 @@ static u8 get_current_channel_802_11n(u8 *msa, u16 rx_len)
s32 wilc_parse_network_info(u8 *msg_buffer,
struct network_info **ret_network_info)
{
struct network_info *network_info = NULL;
u8 msg_type = 0;
u16 wid_len = 0;
u8 *wid_val = NULL;
u8 *msa = NULL;
u16 rx_len = 0;
u8 *tim_elm = NULL;
u8 *ies = NULL;
u16 ies_len = 0;
u8 index = 0;
u32 tsf_lo;
u32 tsf_hi;
struct network_info *network_info;
u8 *wid_val, *msa, *tim_elm, *ies;
u32 tsf_lo, tsf_hi;
u16 wid_len, rx_len, ies_len;
u8 msg_type, index;
msg_type = msg_buffer[0];
......@@ -271,8 +262,8 @@ s32 wilc_parse_network_info(u8 *msg_buffer,
s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len,
struct connect_info *ret_conn_info)
{
u8 *ies = NULL;
u16 ies_len = 0;
u8 *ies;
u16 ies_len;
ret_conn_info->status = get_asoc_status(buffer);
if (ret_conn_info->status == WLAN_STATUS_SUCCESS) {
......
This diff is collapsed.
......@@ -669,7 +669,7 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
static int connect(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_connect_params *sme)
{
s32 ret = 0;
s32 ret;
u32 i;
u32 sel_bssi_idx = UINT_MAX;
u8 security = NO_ENCRYPT;
......@@ -677,7 +677,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
u32 cipher_group;
struct wilc_priv *priv;
struct host_if_drv *wfi_drv;
struct network_info *nw_info = NULL;
struct network_info *nw_info;
struct wilc_vif *vif;
wilc_connecting = 1;
......@@ -818,7 +818,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
static int disconnect(struct wiphy *wiphy, struct net_device *dev,
u16 reason_code)
{
s32 ret = 0;
s32 ret;
struct wilc_priv *priv;
struct host_if_drv *wfi_drv;
struct wilc_vif *vif;
......@@ -1174,7 +1174,7 @@ static int change_bss(struct wiphy *wiphy, struct net_device *dev,
static int set_wiphy_params(struct wiphy *wiphy, u32 changed)
{
s32 ret = 0;
s32 ret;
struct cfg_param_attr cfg_param_val;
struct wilc_priv *priv;
struct wilc_vif *vif;
......@@ -1879,7 +1879,7 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ap_settings *settings)
{
struct cfg80211_beacon_data *beacon = &settings->beacon;
s32 ret = 0;
s32 ret;
struct wilc *wl;
struct wilc_vif *vif;
......@@ -1916,7 +1916,7 @@ static int change_beacon(struct wiphy *wiphy, struct net_device *dev,
static int stop_ap(struct wiphy *wiphy, struct net_device *dev)
{
s32 ret = 0;
s32 ret;
struct wilc_priv *priv;
struct wilc_vif *vif;
u8 null_bssid[ETH_ALEN] = {0};
......@@ -2049,7 +2049,7 @@ static struct wireless_dev *add_virtual_intf(struct wiphy *wiphy,
{
struct wilc_vif *vif;
struct wilc_priv *priv;
struct net_device *new_ifc = NULL;
struct net_device *new_ifc;
priv = wiphy_priv(wiphy);
vif = netdev_priv(priv->wdev->netdev);
......@@ -2215,7 +2215,7 @@ struct wireless_dev *wilc_create_wiphy(struct net_device *net,
{
struct wilc_priv *priv;
struct wireless_dev *wdev;
s32 ret = 0;
s32 ret;
wdev = wilc_wfi_cfg_alloc();
if (!wdev) {
......@@ -2257,7 +2257,7 @@ struct wireless_dev *wilc_create_wiphy(struct net_device *net,
int wilc_init_host_int(struct net_device *net)
{
int ret = 0;
int ret;
struct wilc_priv *priv;
priv = wdev_priv(net->ieee80211_ptr);
......@@ -2279,7 +2279,7 @@ int wilc_init_host_int(struct net_device *net)
int wilc_deinit_host_int(struct net_device *net)
{
int ret = 0;
int ret;
struct wilc_vif *vif;
struct wilc_priv *priv;
......
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