aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2007-06-16 03:38:41 -0400
committerGuido Guenther <agx@sigxcpu.org>2007-06-16 13:42:57 +0200
commit2b2123391762c827ef3eff1708393c18613f9424 (patch)
treee055783b63f2cc79237db237c9835ee39cc3e61d
parent4176d78759eedfab4dc08e7bde8991fb7942bf5c (diff)
[PATCH] Always use cpu_to_le16 to populate priv->mib_buf.data with 16-bit data
Signed-off-by: Pavel Roskin <proski@gnu.org>
-rw-r--r--at76_usb.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/at76_usb.c b/at76_usb.c
index 49747c1..c8312b0 100644
--- a/at76_usb.c
+++ b/at76_usb.c
@@ -938,8 +938,7 @@ static int at76_set_associd(struct at76_priv *priv, u16 id)
priv->mib_buf.size = 2;
priv->mib_buf.index = offsetof(struct mib_mac_mgmt, station_id);
- priv->mib_buf.data[0] = id & 0xff;
- priv->mib_buf.data[1] = id >> 8;
+ *(__le16 *)priv->mib_buf.data = cpu_to_le16(id);
ret = at76_set_mib(priv, &priv->mib_buf);
if (ret < 0) {
@@ -960,8 +959,7 @@ static int at76_set_listen_interval(struct at76_priv *priv, u16 interval)
priv->mib_buf.size = 2;
priv->mib_buf.index = offsetof(struct mib_mac_mgmt, station_id);
- priv->mib_buf.data[0] = interval & 0xff;
- priv->mib_buf.data[1] = interval >> 8;
+ *(__le16 *)priv->mib_buf.data = cpu_to_le16(interval);
ret = at76_set_mib(priv, &priv->mib_buf);
if (ret < 0) {