diff mbox

[next-queue,v5,06/17] fm10k: Correct typecast in fm10k_update_xc_addr_pf

Message ID 1445018231-3196-6-git-send-email-jacob.e.keller@intel.com
State Accepted
Delegated to: Jeff Kirsher
Headers show

Commit Message

Keller, Jacob E Oct. 16, 2015, 5:57 p.m. UTC
Since the resultant data type of the mac_update.mac_upper field is u16,
it does not make sense to typecast u8 variables to u32 first. Since
we're modifying fm10k_pf.c, also update the copyright year.

Reported-by: Matthew Vick <matthew.vick@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_pf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Allan, Bruce W Oct. 16, 2015, 11:40 p.m. UTC | #1
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@lists.osuosl.org] On
> Behalf Of Jacob Keller
> Sent: Friday, October 16, 2015 10:57 AM
> To: Intel Wired LAN
> Subject: [Intel-wired-lan] [next-queue v5 06/17] fm10k: Correct typecast in
> fm10k_update_xc_addr_pf
> 
> Since the resultant data type of the mac_update.mac_upper field is u16,
> it does not make sense to typecast u8 variables to u32 first. Since
> we're modifying fm10k_pf.c, also update the copyright year.
> 
> Reported-by: Matthew Vick <matthew.vick@intel.com>
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  drivers/net/ethernet/intel/fm10k/fm10k_pf.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Bruce Allan <bruce.w.allan@intel.com>
Singh, Krishneil K Oct. 28, 2015, 12:23 a.m. UTC | #2
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces@lists.osuosl.org] On Behalf Of Allan, Bruce W
Sent: Friday, October 16, 2015 4:41 PM
To: Keller, Jacob E <jacob.e.keller@intel.com>; Intel Wired LAN <intel-wired-lan@lists.osuosl.org>
Subject: Re: [Intel-wired-lan] [next-queue v5 06/17] fm10k: Correct typecast in fm10k_update_xc_addr_pf

> -----Original Message-----
> From: Intel-wired-lan 
> [mailto:intel-wired-lan-bounces@lists.osuosl.org] On Behalf Of Jacob 
> Keller
> Sent: Friday, October 16, 2015 10:57 AM
> To: Intel Wired LAN
> Subject: [Intel-wired-lan] [next-queue v5 06/17] fm10k: Correct 
> typecast in fm10k_update_xc_addr_pf
> 
> Since the resultant data type of the mac_update.mac_upper field is 
> u16, it does not make sense to typecast u8 variables to u32 first. 
> Since we're modifying fm10k_pf.c, also update the copyright year.
> 
> Reported-by: Matthew Vick <matthew.vick@intel.com>
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  drivers/net/ethernet/intel/fm10k/fm10k_pf.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)


Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com>
diff mbox

Patch

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pf.c b/drivers/net/ethernet/intel/fm10k/fm10k_pf.c
index 8c0bdc4e4edd..b1e09756a6ef 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pf.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pf.c
@@ -1,5 +1,5 @@ 
 /* Intel Ethernet Switch Host Interface Driver
- * Copyright(c) 2013 - 2014 Intel Corporation.
+ * Copyright(c) 2013 - 2015 Intel Corporation.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -334,8 +334,8 @@  static s32 fm10k_update_xc_addr_pf(struct fm10k_hw *hw, u16 glort,
 						 ((u32)mac[3] << 16) |
 						 ((u32)mac[4] << 8) |
 						 ((u32)mac[5]));
-	mac_update.mac_upper = cpu_to_le16(((u32)mac[0] << 8) |
-						 ((u32)mac[1]));
+	mac_update.mac_upper = cpu_to_le16(((u16)mac[0] << 8) |
+					   ((u16)mac[1]));
 	mac_update.vlan = cpu_to_le16(vid);
 	mac_update.glort = cpu_to_le16(glort);
 	mac_update.action = add ? 0 : 1;