aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2011-05-10 23:47:35 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-05-11 14:50:42 -0400
commitc4859fbcfc12d5cfe8c30a33ad37d192a3093a7b (patch)
treeaf8e9d6f935f62e453ec84a554d39a374ddcb053 /drivers
parent0fd82eafe3aa70937905b7e19e256409ae48477e (diff)
mwifiex: remove redundant local structures
Avoid use of local structure in the function if the structure is already allocated by the caller and the structure pointer is passed. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/mwifiex/sta_ioctl.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 75bca56449cb..d05907d05039 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -1250,11 +1250,9 @@ mwifiex_drv_get_driver_version(struct mwifiex_adapter *adapter, char *version,
1250int mwifiex_get_signal_info(struct mwifiex_private *priv, 1250int mwifiex_get_signal_info(struct mwifiex_private *priv,
1251 struct mwifiex_ds_get_signal *signal) 1251 struct mwifiex_ds_get_signal *signal)
1252{ 1252{
1253 struct mwifiex_ds_get_signal info;
1254 int status; 1253 int status;
1255 1254
1256 memset(&info, 0, sizeof(struct mwifiex_ds_get_signal)); 1255 signal->selector = ALL_RSSI_INFO_MASK;
1257 info.selector = ALL_RSSI_INFO_MASK;
1258 1256
1259 /* Signal info can be obtained only if connected */ 1257 /* Signal info can be obtained only if connected */
1260 if (!priv->media_connected) { 1258 if (!priv->media_connected) {
@@ -1267,13 +1265,10 @@ int mwifiex_get_signal_info(struct mwifiex_private *priv,
1267 HostCmd_ACT_GEN_GET, 0, signal); 1265 HostCmd_ACT_GEN_GET, 0, signal);
1268 1266
1269 if (!status) { 1267 if (!status) {
1270 if (signal) 1268 if (signal->selector & BCN_RSSI_AVG_MASK)
1271 memcpy(signal, &info, 1269 priv->w_stats.qual.level = signal->bcn_rssi_avg;
1272 sizeof(struct mwifiex_ds_get_signal)); 1270 if (signal->selector & BCN_NF_AVG_MASK)
1273 if (info.selector & BCN_RSSI_AVG_MASK) 1271 priv->w_stats.qual.noise = signal->bcn_nf_avg;
1274 priv->w_stats.qual.level = info.bcn_rssi_avg;
1275 if (info.selector & BCN_NF_AVG_MASK)
1276 priv->w_stats.qual.noise = info.bcn_nf_avg;
1277 } 1272 }
1278 1273
1279 return status; 1274 return status;
@@ -1333,19 +1328,14 @@ mwifiex_get_stats_info(struct mwifiex_private *priv,
1333 struct mwifiex_ds_get_stats *log) 1328 struct mwifiex_ds_get_stats *log)
1334{ 1329{
1335 int ret; 1330 int ret;
1336 struct mwifiex_ds_get_stats get_log;
1337 1331
1338 memset(&get_log, 0, sizeof(struct mwifiex_ds_get_stats));
1339 ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_GET_LOG, 1332 ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_GET_LOG,
1340 HostCmd_ACT_GEN_GET, 0, &get_log); 1333 HostCmd_ACT_GEN_GET, 0, log);
1341 1334
1342 if (!ret) { 1335 if (!ret) {
1343 if (log) 1336 priv->w_stats.discard.fragment = log->fcs_error;
1344 memcpy(log, &get_log, sizeof(struct 1337 priv->w_stats.discard.retries = log->retry;
1345 mwifiex_ds_get_stats)); 1338 priv->w_stats.discard.misc = log->ack_failure;
1346 priv->w_stats.discard.fragment = get_log.fcs_error;
1347 priv->w_stats.discard.retries = get_log.retry;
1348 priv->w_stats.discard.misc = get_log.ack_failure;
1349 } 1339 }
1350 1340
1351 return ret; 1341 return ret;