summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/marvell/mwifiex
diff options
context:
space:
mode:
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>2016-08-31 13:50:59 +0200
committerKalle Valo <kvalo@codeaurora.org>2016-09-09 12:21:25 +0300
commitb711657616947e7b4c15f6825d259324216b23f2 (patch)
tree4c03bf3a3cc72b510a0a5cc6c7439e5c811ba51b /drivers/net/wireless/marvell/mwifiex
parent4c5dae59d2e9386c706a2f3c7c2746ae277bf568 (diff)
downloadop-kernel-dev-b711657616947e7b4c15f6825d259324216b23f2.zip
op-kernel-dev-b711657616947e7b4c15f6825d259324216b23f2.tar.gz
mwifiex: scan: Simplify code
This patch: - improves code layout - removes a useless memset(0) for some memory allocated with kzalloc - removes a useless if. We know that 'if (chan_band_tlv)' will succeed because it has been tested a few lines above Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/marvell/mwifiex')
-rw-r--r--drivers/net/wireless/marvell/mwifiex/scan.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c
index 8daf0d86..97c9765 100644
--- a/drivers/net/wireless/marvell/mwifiex/scan.c
+++ b/drivers/net/wireless/marvell/mwifiex/scan.c
@@ -2194,18 +2194,14 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
if (chan_band_tlv && adapter->nd_info) {
adapter->nd_info->matches[idx] =
- kzalloc(sizeof(*pmatch) +
- sizeof(u32), GFP_ATOMIC);
+ kzalloc(sizeof(*pmatch) + sizeof(u32),
+ GFP_ATOMIC);
pmatch = adapter->nd_info->matches[idx];
if (pmatch) {
- memset(pmatch, 0, sizeof(*pmatch));
- if (chan_band_tlv) {
- pmatch->n_channels = 1;
- pmatch->channels[0] =
- chan_band->chan_number;
- }
+ pmatch->n_channels = 1;
+ pmatch->channels[0] = chan_band->chan_number;
}
}
OpenPOWER on IntegriCloud