From: Stanislaw Gruszka <sgruszka@redhat.com>
To: linux-wireless@vger.kernel.org
Cc: Felix Fietkau <nbd@nbd.name>,
Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Subject: Re: [PATCH 1/3] mt76: usb: fix endian in mt76u_copy
Date: Tue, 9 Jul 2019 12:06:18 +0200 [thread overview]
Message-ID: <20190709100617.GA3099@redhat.com> (raw)
In-Reply-To: <1562079961-15527-2-git-send-email-sgruszka@redhat.com>
On Tue, Jul 02, 2019 at 05:05:59PM +0200, Stanislaw Gruszka wrote:
> In contrast to mt76_wr() which we use to program registers,
> on mt76_wr_copy() we should not change endian of the data.
>
> Fixes: b40b15e1521f ("mt76: add usb support to mt76 layer")
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
> drivers/net/wireless/mediatek/mt76/usb.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c
> index 87ecbe290f99..db90ec6b8775 100644
> --- a/drivers/net/wireless/mediatek/mt76/usb.c
> +++ b/drivers/net/wireless/mediatek/mt76/usb.c
> @@ -165,11 +165,11 @@ static void mt76u_copy(struct mt76_dev *dev, u32 offset,
>
> mutex_lock(&usb->usb_ctrl_mtx);
> for (i = 0; i < DIV_ROUND_UP(len, 4); i++) {
> - put_unaligned_le32(val[i], usb->data);
> + put_unaligned(val[i], usb->data);
This is bug as put_unaligned() use size based second argument
pointer type, correct version should looks like this:
put_unaligned(val[i], (u32 *) usb->data);
Stanislaw
next prev parent reply other threads:[~2019-07-09 10:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-02 15:05 [PATCH 0/3] mt76: usb: alignment and endianes improvements Stanislaw Gruszka
2019-07-02 15:05 ` [PATCH 1/3] mt76: usb: fix endian in mt76u_copy Stanislaw Gruszka
2019-07-09 10:06 ` Stanislaw Gruszka [this message]
2019-07-02 15:06 ` [PATCH 2/3] mt76: usb: remove unneeded {put,get}_unaligned Stanislaw Gruszka
2019-07-02 15:06 ` [PATCH 3/3] mt76: usb: use full intermediate buffer in mt76u_copy Stanislaw Gruszka
2019-07-09 10:12 ` Stanislaw Gruszka
2019-07-09 13:45 ` Felix Fietkau
2019-07-03 22:12 ` [PATCH 0/3] mt76: usb: alignment and endianes improvements Lorenzo Bianconi
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=20190709100617.GA3099@redhat.com \
--to=sgruszka@redhat.com \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=nbd@nbd.name \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.