lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0810280019330.9949@melkki.cs.Helsinki.FI>
Date:	Tue, 28 Oct 2008 00:20:03 +0200 (EET)
From:	Pekka J Enberg <penberg@...helsinki.fi>
To:	greg@...ah.com
cc:	pavel@...e.cz, linux-kernel@...r.kernel.org
Subject: [PATCH] w35und: move supported band initialization out of wb35_probe()

From: Pekka Enberg <penberg@...helsinki.fi>

This patch moves the static struct ieee80211_supported_band initialization out
of w35_probe() because it's really global read-only configuration data.

Cc: Pavel Machek <pavel@...e.cz>
Signed-off-by: Pekka Enberg <penberg@...helsinki.fi>
---
 drivers/staging/winbond/linux/wbusb.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/winbond/linux/wbusb.c b/drivers/staging/winbond/linux/wbusb.c
index a4403d2..582ede4 100644
--- a/drivers/staging/winbond/linux/wbusb.c
+++ b/drivers/staging/winbond/linux/wbusb.c
@@ -32,6 +32,13 @@ static struct ieee80211_channel wbsoft_channels[] = {
 	{ .center_freq = 2412},
 };
 
+static struct ieee80211_supported_band wbsoft_band_2GHz = {
+	.channels	= wbsoft_channels,
+	.n_channels	= ARRAY_SIZE(wbsoft_channels),
+	.bitrates	= wbsoft_rates,
+	.n_bitrates	= ARRAY_SIZE(wbsoft_rates),
+};
+
 int wbsoft_enabled;
 struct ieee80211_hw *my_dev;
 struct wb35_adapter * my_adapter;
@@ -195,7 +202,6 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
 	struct usb_device *udev = interface_to_usbdev(intf);
 	struct wbsoft_priv *priv;
 	struct ieee80211_hw *dev;
-	static struct ieee80211_supported_band band;
 	int err;
 
 	usb_get_dev(udev);
@@ -256,12 +262,7 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
 	dev->channel_change_time = 1000;
 	dev->queues = 1;
 
-	band.channels = wbsoft_channels;
-	band.n_channels = ARRAY_SIZE(wbsoft_channels);
-	band.bitrates = wbsoft_rates;
-	band.n_bitrates = ARRAY_SIZE(wbsoft_rates);
-
-	dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &band;
+	dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &wbsoft_band_2GHz;
 
 	err = ieee80211_register_hw(dev);
 	if (err)
-- 
1.5.3.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ