[next,S74-V2,01/10] i40e/i40evf: fix some minor type mismatches

Message ID 20170623082451.32671-1-alice.michael@intel.com
State Changes Requested
Delegated to: Jeff Kirsher
Headers show

Commit Message

Alice Michael June 23, 2017, 8:24 a.m.
From: Jesse Brandeburg <jesse.brandeburg@intel.com>

This patch fixes two trivial type mismatches, one where
we were returning an enum type, but pretending it was an int,
and the other where we were using a void* for offset math, but
it is communicated more clearly and correctly to use a u8*,
which we then cast to void* for prefetch to use.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Change-ID: I8d9cf84a1ddbcff7f31eaad9e08880cad4a71f5f
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 4 ++--
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

Comments

Bowers, AndrewX June 28, 2017, 10:41 p.m. | #1
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On
> Behalf Of Alice Michael
> Sent: Friday, June 23, 2017 1:25 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan@lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S74-V2 01/10] i40e/i40evf: fix some
> minor type mismatches
> 
> From: Jesse Brandeburg <jesse.brandeburg@intel.com>
> 
> This patch fixes two trivial type mismatches, one where we were returning
> an enum type, but pretending it was an int, and the other where we were
> using a void* for offset math, but it is communicated more clearly and
> correctly to use a u8*, which we then cast to void* for prefetch to use.
> 
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Change-ID: I8d9cf84a1ddbcff7f31eaad9e08880cad4a71f5f
> ---
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 4 ++--
>  drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 6 +++---
>  2 files changed, 5 insertions(+), 5 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>

Patch

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index d464fce..eda8da1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1524,7 +1524,7 @@  static inline void i40e_rx_checksum(struct i40e_vsi *vsi,
  *
  * Returns a hash type to be used by skb_set_hash
  **/
-static inline int i40e_ptype_to_htype(u8 ptype)
+static inline enum pkt_hash_types i40e_ptype_to_htype(u8 ptype)
 {
 	struct i40e_rx_ptype_decoded decoded = decode_rx_desc_ptype(ptype);
 
@@ -1828,7 +1828,7 @@  static struct sk_buff *i40e_construct_skb(struct i40e_ring *rx_ring,
 	/* prefetch first cache line of first page */
 	prefetch(xdp->data);
 #if L1_CACHE_BYTES < 128
-	prefetch(xdp->data + L1_CACHE_BYTES);
+	prefetch((void *)(xdp->data + L1_CACHE_BYTES));
 #endif
 
 	/* allocate a skb to store the frags */
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index d91676c..4bf7e35 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -858,7 +858,7 @@  static inline void i40e_rx_checksum(struct i40e_vsi *vsi,
  *
  * Returns a hash type to be used by skb_set_hash
  **/
-static inline int i40e_ptype_to_htype(u8 ptype)
+static inline enum pkt_hash_types i40e_ptype_to_htype(u8 ptype)
 {
 	struct i40e_rx_ptype_decoded decoded = decode_rx_desc_ptype(ptype);
 
@@ -1122,7 +1122,7 @@  static struct sk_buff *i40e_construct_skb(struct i40e_ring *rx_ring,
 					  struct i40e_rx_buffer *rx_buffer,
 					  unsigned int size)
 {
-	void *va = page_address(rx_buffer->page) + rx_buffer->page_offset;
+	u8 *va = page_address(rx_buffer->page) + rx_buffer->page_offset;
 #if (PAGE_SIZE < 8192)
 	unsigned int truesize = i40e_rx_pg_size(rx_ring) / 2;
 #else
@@ -1134,7 +1134,7 @@  static struct sk_buff *i40e_construct_skb(struct i40e_ring *rx_ring,
 	/* prefetch first cache line of first page */
 	prefetch(va);
 #if L1_CACHE_BYTES < 128
-	prefetch(va + L1_CACHE_BYTES);
+	prefetch((void *)(va + L1_CACHE_BYTES));
 #endif
 
 	/* allocate a skb to store the frags */