Skip to content

Commit

Permalink
rndis_wlan: Use static const
Browse files Browse the repository at this point in the history
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text	   data	    bss	    dec	    hex	filename
  41757	   2205	   9896	  53858	   d262	drivers/net/wireless/rndis_wlan.o.old
  41653	   2205	   9880	  53738	   d1ea	drivers/net/wireless/rndis_wlan.o.new

Changed functions rndis_set_oid and set_bssid to take const *'s.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Joe Perches authored and John W. Linville committed Nov 22, 2010
1 parent ff273b9 commit 22288a5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/net/wireless/rndis_wlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,8 @@ static int rndis_query_oid(struct usbnet *dev, __le32 oid, void *data, int *len)
return ret;
}

static int rndis_set_oid(struct usbnet *dev, __le32 oid, void *data, int len)
static int rndis_set_oid(struct usbnet *dev, __le32 oid, const void *data,
int len)
{
struct rndis_wlan_private *priv = get_rndis_wlan_priv(dev);
union {
Expand Down Expand Up @@ -1033,7 +1034,7 @@ static int set_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid)
return ret;
}

static int set_bssid(struct usbnet *usbdev, u8 bssid[ETH_ALEN])
static int set_bssid(struct usbnet *usbdev, const u8 *bssid)
{
int ret;

Expand All @@ -1049,7 +1050,9 @@ static int set_bssid(struct usbnet *usbdev, u8 bssid[ETH_ALEN])

static int clear_bssid(struct usbnet *usbdev)
{
u8 broadcast_mac[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
static const u8 broadcast_mac[ETH_ALEN] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};

return set_bssid(usbdev, broadcast_mac);
}
Expand Down

0 comments on commit 22288a5

Please sign in to comment.