From: Dan Williams <dcbw@redhat.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: linux-wireless@vger.kernel.org, Cliff Cai <cliff.cai@analog.com>,
Bryan Wu <cooloney@kernel.org>
Subject: Re: [PATCH] wireless: libertas: fix unaligned accesses
Date: Wed, 27 May 2009 14:06:43 -0400 [thread overview]
Message-ID: <1243447603.17301.24.camel@localhost.localdomain> (raw)
In-Reply-To: <1243447389-6715-1-git-send-email-vapier@gentoo.org>
On Wed, 2009-05-27 at 14:03 -0400, Mike Frysinger wrote:
> From: Cliff Cai <cliff.cai@analog.com>
>
> Signed-off-by: Cliff Cai <cliff.cai@analog.com>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Acked-by: Dan Williams <dcbw@redhat.com>
> ---
> drivers/net/wireless/libertas/cmdresp.c | 10 +++++-----
> drivers/net/wireless/libertas/scan.c | 2 +-
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
> index bcf2a97..c3e947c 100644
> --- a/drivers/net/wireless/libertas/cmdresp.c
> +++ b/drivers/net/wireless/libertas/cmdresp.c
> @@ -5,7 +5,7 @@
> #include <linux/delay.h>
> #include <linux/if_arp.h>
> #include <linux/netdevice.h>
> -
> +#include <asm/unaligned.h>
> #include <net/iw_handler.h>
>
> #include "host.h"
> @@ -154,11 +154,11 @@ static int lbs_ret_802_11_rssi(struct lbs_private *priv,
> lbs_deb_enter(LBS_DEB_CMD);
>
> /* store the non average value */
> - priv->SNR[TYPE_BEACON][TYPE_NOAVG] = le16_to_cpu(rssirsp->SNR);
> - priv->NF[TYPE_BEACON][TYPE_NOAVG] = le16_to_cpu(rssirsp->noisefloor);
> + priv->SNR[TYPE_BEACON][TYPE_NOAVG] = get_unaligned_le16(&rssirsp->SNR);
> + priv->NF[TYPE_BEACON][TYPE_NOAVG] = get_unaligned_le16(&rssirsp->noisefloor);
>
> - priv->SNR[TYPE_BEACON][TYPE_AVG] = le16_to_cpu(rssirsp->avgSNR);
> - priv->NF[TYPE_BEACON][TYPE_AVG] = le16_to_cpu(rssirsp->avgnoisefloor);
> + priv->SNR[TYPE_BEACON][TYPE_AVG] = get_unaligned_le16(&rssirsp->avgSNR);
> + priv->NF[TYPE_BEACON][TYPE_AVG] = get_unaligned_le16(&rssirsp->avgnoisefloor);
>
> priv->RSSI[TYPE_BEACON][TYPE_NOAVG] =
> CAL_RSSI(priv->SNR[TYPE_BEACON][TYPE_NOAVG],
> diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
> index 8124db3..68bf6b7 100644
> --- a/drivers/net/wireless/libertas/scan.c
> +++ b/drivers/net/wireless/libertas/scan.c
> @@ -1130,7 +1130,7 @@ static int lbs_ret_80211_scan(struct lbs_private *priv, unsigned long dummy,
> goto done;
> }
>
> - bytesleft = le16_to_cpu(scanresp->bssdescriptsize);
> + bytesleft = get_unaligned_le16(&scanresp->bssdescriptsize);
> lbs_deb_scan("SCAN_RESP: bssdescriptsize %d\n", bytesleft);
>
> scanrespsize = le16_to_cpu(resp->size);
prev parent reply other threads:[~2009-05-27 18:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-27 18:03 [PATCH] wireless: libertas: fix unaligned accesses Mike Frysinger
2009-05-27 18:06 ` Dan Williams [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1243447603.17301.24.camel@localhost.localdomain \
--to=dcbw@redhat.com \
--cc=cliff.cai@analog.com \
--cc=cooloney@kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=vapier@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox