From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: "David S. Miller" <davem@davemloft.net>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] net: qrtr: Mark 'buf' as little endian
Date: Mon, 9 Jan 2017 15:02:14 -0800 [thread overview]
Message-ID: <20170109230214.GX10531@minitux> (raw)
In-Reply-To: <20170109223158.29255-1-sboyd@codeaurora.org>
On Mon 09 Jan 14:31 PST 2017, Stephen Boyd wrote:
> Failure to mark this pointer as __le32 causes checkers like
> sparse to complain:
>
> net/qrtr/qrtr.c:274:16: warning: incorrect type in assignment (different base types)
> net/qrtr/qrtr.c:274:16: expected unsigned int [unsigned] [usertype] <noident>
> net/qrtr/qrtr.c:274:16: got restricted __le32 [usertype] <noident>
> net/qrtr/qrtr.c:275:16: warning: incorrect type in assignment (different base types)
> net/qrtr/qrtr.c:275:16: expected unsigned int [unsigned] [usertype] <noident>
> net/qrtr/qrtr.c:275:16: got restricted __le32 [usertype] <noident>
> net/qrtr/qrtr.c:276:16: warning: incorrect type in assignment (different base types)
> net/qrtr/qrtr.c:276:16: expected unsigned int [unsigned] [usertype] <noident>
> net/qrtr/qrtr.c:276:16: got restricted __le32 [usertype] <noident>
>
> Silence it.
>
> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Regards,
Bjorn
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
> net/qrtr/qrtr.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
> index c985ecbe9bd6..ae5ac175b2be 100644
> --- a/net/qrtr/qrtr.c
> +++ b/net/qrtr/qrtr.c
> @@ -252,7 +252,7 @@ static struct sk_buff *qrtr_alloc_resume_tx(u32 src_node,
> const int pkt_len = 20;
> struct qrtr_hdr *hdr;
> struct sk_buff *skb;
> - u32 *buf;
> + __le32 *buf;
>
> skb = alloc_skb(QRTR_HDR_SIZE + pkt_len, GFP_KERNEL);
> if (!skb)
> @@ -269,7 +269,7 @@ static struct sk_buff *qrtr_alloc_resume_tx(u32 src_node,
> hdr->dst_node_id = cpu_to_le32(dst_node);
> hdr->dst_port_id = cpu_to_le32(QRTR_PORT_CTRL);
>
> - buf = (u32 *)skb_put(skb, pkt_len);
> + buf = (__le32 *)skb_put(skb, pkt_len);
> memset(buf, 0, pkt_len);
> buf[0] = cpu_to_le32(QRTR_TYPE_RESUME_TX);
> buf[1] = cpu_to_le32(src_node);
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
next prev parent reply other threads:[~2017-01-09 23:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-09 22:31 [PATCH] net: qrtr: Mark 'buf' as little endian Stephen Boyd
2017-01-09 23:02 ` Bjorn Andersson [this message]
2017-01-11 1:45 ` David Miller
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=20170109230214.GX10531@minitux \
--to=bjorn.andersson@linaro.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sboyd@codeaurora.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 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.