Commit 8f5e2451 authored by Nicholas Mc Guire's avatar Nicholas Mc Guire Committed by David S. Miller

net: qrtr: use protocol endiannes variable

sparse was unable to verify endiannes correctness due to reassignment
from le32_to_cpu to the same variable - fix this warning up by providing
a proper __le32 type and initializing it. This is not actually fixing
any bug - rather just addressing the sparse warning.
Signed-off-by: default avatarNicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent daf3ddbe
...@@ -728,12 +728,13 @@ static int qrtr_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) ...@@ -728,12 +728,13 @@ static int qrtr_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
DECLARE_SOCKADDR(struct sockaddr_qrtr *, addr, msg->msg_name); DECLARE_SOCKADDR(struct sockaddr_qrtr *, addr, msg->msg_name);
int (*enqueue_fn)(struct qrtr_node *, struct sk_buff *, int, int (*enqueue_fn)(struct qrtr_node *, struct sk_buff *, int,
struct sockaddr_qrtr *, struct sockaddr_qrtr *); struct sockaddr_qrtr *, struct sockaddr_qrtr *);
__le32 qrtr_type = cpu_to_le32(QRTR_TYPE_DATA);
struct qrtr_sock *ipc = qrtr_sk(sock->sk); struct qrtr_sock *ipc = qrtr_sk(sock->sk);
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct qrtr_node *node; struct qrtr_node *node;
struct sk_buff *skb; struct sk_buff *skb;
u32 type = 0;
size_t plen; size_t plen;
u32 type = QRTR_TYPE_DATA;
int rc; int rc;
if (msg->msg_flags & ~(MSG_DONTWAIT)) if (msg->msg_flags & ~(MSG_DONTWAIT))
...@@ -807,8 +808,8 @@ static int qrtr_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) ...@@ -807,8 +808,8 @@ static int qrtr_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
} }
/* control messages already require the type as 'command' */ /* control messages already require the type as 'command' */
skb_copy_bits(skb, 0, &type, 4); skb_copy_bits(skb, 0, &qrtr_type, 4);
type = le32_to_cpu(type); type = le32_to_cpu(qrtr_type);
} }
rc = enqueue_fn(node, skb, type, &ipc->us, addr); rc = enqueue_fn(node, skb, type, &ipc->us, addr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment