target/cxgbit: Fix endianness annotations
authorBart Van Assche <bart.vanassche@sandisk.com>
Fri, 13 Jan 2017 18:41:52 +0000 (10:41 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Thu, 9 Feb 2017 08:39:05 +0000 (00:39 -0800)
This patch does not change any functionality but avoids that sparse
complains about endianness.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Acked-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.h
drivers/target/iscsi/cxgbit/cxgbit_cm.c
drivers/target/iscsi/cxgbit/cxgbit_main.c
drivers/target/iscsi/cxgbit/cxgbit_target.c

index e995a1a3840a664c7155f08546a600bab88e6074..a91ad766cef0097393f873d72e0d6a79d8f6e576 100644 (file)
@@ -59,7 +59,7 @@ struct cxgbi_pagepod_hdr {
 #define PPOD_PAGES_MAX                 4
 struct cxgbi_pagepod {
        struct cxgbi_pagepod_hdr hdr;
-       u64 addr[PPOD_PAGES_MAX + 1];
+       __be64 addr[PPOD_PAGES_MAX + 1];
 };
 
 /* ddp tag format
index 2fb1bf1a26c5e6a0488869cf91d29935a3301af1..35aaa36e9af50ae351c697b46b0d3e911e7cc1ea 100644 (file)
@@ -1726,7 +1726,7 @@ static bool cxgbit_credit_err(const struct cxgbit_sock *csk)
        }
 
        while (skb) {
-               credit += skb->csum;
+               credit += (__force u32)skb->csum;
                skb = cxgbit_skcb_tx_wr_next(skb);
        }
 
@@ -1753,6 +1753,7 @@ static void cxgbit_fw4_ack(struct cxgbit_sock *csk, struct sk_buff *skb)
 
        while (credits) {
                struct sk_buff *p = cxgbit_sock_peek_wr(csk);
+               const u32 csum = (__force u32)p->csum;
 
                if (unlikely(!p)) {
                        pr_err("csk 0x%p,%u, cr %u,%u+%u, empty.\n",
@@ -1761,17 +1762,17 @@ static void cxgbit_fw4_ack(struct cxgbit_sock *csk, struct sk_buff *skb)
                        break;
                }
 
-               if (unlikely(credits < p->csum)) {
+               if (unlikely(credits < csum)) {
                        pr_warn("csk 0x%p,%u, cr %u,%u+%u, < %u.\n",
                                csk,  csk->tid,
                                credits, csk->wr_cred, csk->wr_una_cred,
-                               p->csum);
-                       p->csum -= credits;
+                               csum);
+                       p->csum = (__force __wsum)(csum - credits);
                        break;
                }
 
                cxgbit_sock_dequeue_wr(csk);
-               credits -= p->csum;
+               credits -= csum;
                kfree_skb(p);
        }
 
index 96eedfc49c9428938dfdd9fe483d37a0735b7a14..6531aaac2b9681192dc89e9a23ba2842380c8867 100644 (file)
@@ -454,7 +454,7 @@ cxgbit_uld_lro_rx_handler(void *hndl, const __be64 *rsp,
                if (unlikely(op != *(u8 *)gl->va)) {
                        pr_info("? FL 0x%p,RSS%#llx,FL %#llx,len %u.\n",
                                gl->va, be64_to_cpu(*rsp),
-                               be64_to_cpu(*(u64 *)gl->va),
+                               get_unaligned_be64(gl->va),
                                gl->tot_len);
                        return 0;
                }
index 8bcb9b71f764325d585f659fb1430b393b54214c..e183e0bdd3bf85ce42bd898aebdb482261714cc3 100644 (file)
@@ -243,7 +243,7 @@ void cxgbit_push_tx_frames(struct cxgbit_sock *csk)
                }
                __skb_unlink(skb, &csk->txq);
                set_wr_txq(skb, CPL_PRIORITY_DATA, csk->txq_idx);
-               skb->csum = credits_needed + flowclen16;
+               skb->csum = (__force __wsum)(credits_needed + flowclen16);
                csk->wr_cred -= credits_needed;
                csk->wr_una_cred += credits_needed;