projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c5dae5
)
mwifiex: scan: Simplify code
author
Christophe Jaillet
<
[email protected]
>
Wed, 31 Aug 2016 11:50:59 +0000
(13:50 +0200)
committer
Kalle Valo
<
[email protected]
>
Fri, 9 Sep 2016 09:21:25 +0000
(12:21 +0300)
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 <
[email protected]
>
Signed-off-by: Kalle Valo <
[email protected]
>
drivers/net/wireless/marvell/mwifiex/scan.c
patch
|
blob
|
history
diff --git
a/drivers/net/wireless/marvell/mwifiex/scan.c
b/drivers/net/wireless/marvell/mwifiex/scan.c
index 8daf0d8657b961a743c437832b5873cd05b70a00..97c9765b5bc6a33396085fa18286c5969867ea63 100644
(file)
--- 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;
}
}