bnx2x: Fix sparse warnings
authorYuval Mintz <Yuval.Mintz@qlogic.com>
Thu, 28 Aug 2014 05:07:32 +0000 (08:07 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 30 Aug 2014 03:34:59 +0000 (20:34 -0700)
This fixes a sprase warning introduced recently by commit
eeed018cbfa30 ("bnx2x: Add timestamping and PTP hardware clock support"),
as well as another unrelated sparse endian issue.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c

index a54ac4560900a52d45b72f9e4535fd86bac83a79..06d6d3c9316bd06c36b5f9a4c30347482c420fd8 100644 (file)
@@ -1065,7 +1065,7 @@ reuse_rx:
                skb_record_rx_queue(skb, fp->rx_queue);
 
                /* Check if this packet was timestamped */
-               if (unlikely(le16_to_cpu(cqe->fast_path_cqe.type_error_flags) &
+               if (unlikely(cqe->fast_path_cqe.type_error_flags &
                             (1 << ETH_FAST_PATH_RX_CQE_PTP_PKT_SHIFT)))
                        bnx2x_set_rx_ts(bp, skb);
 
index 38acecdd8e9b0a6ebbb649d5bfc24fd467a06464..19d0c1152434e4d8e75a71510dadae8e16c25ae1 100644 (file)
@@ -4063,6 +4063,13 @@ static int bnx2x_setup_rss(struct bnx2x *bp,
        if (test_bit(BNX2X_RSS_GRE_INNER_HDRS, &p->rss_flags))
                caps |= ETH_RSS_UPDATE_RAMROD_DATA_GRE_INNER_HDRS_CAPABILITY;
 
+       /* RSS keys */
+       if (test_bit(BNX2X_RSS_SET_SRCH, &p->rss_flags)) {
+               memcpy(&data->rss_key[0], &p->rss_key[0],
+                      sizeof(data->rss_key));
+               caps |= ETH_RSS_UPDATE_RAMROD_DATA_UPDATE_RSS_KEY;
+       }
+
        data->capabilities = cpu_to_le16(caps);
 
        /* Hashing mask */
@@ -4084,13 +4091,6 @@ static int bnx2x_setup_rss(struct bnx2x *bp,
        if (netif_msg_ifup(bp))
                bnx2x_debug_print_ind_table(bp, p);
 
-       /* RSS keys */
-       if (test_bit(BNX2X_RSS_SET_SRCH, &p->rss_flags)) {
-               memcpy(&data->rss_key[0], &p->rss_key[0],
-                      sizeof(data->rss_key));
-               data->capabilities |= ETH_RSS_UPDATE_RAMROD_DATA_UPDATE_RSS_KEY;
-       }
-
        /* No need for an explicit memory barrier here as long as we
         * ensure the ordering of writing to the SPQ element
         * and updating of the SPQ producer which involves a memory