fm10k/base: fix typecast
authorXiao Wang <xiao.w.wang@intel.com>
Fri, 19 Feb 2016 11:06:49 +0000 (19:06 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 16 Mar 2016 17:51:43 +0000 (18:51 +0100)
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.

Fixes: 7223d200c227 ("fm10k: add base driver")

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
drivers/net/fm10k/base/fm10k_pf.c

index 6e6d71e..4a028f3 100644 (file)
@@ -379,8 +379,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 = FM10K_CPU_TO_LE16(((u32)mac[0] << 8) |
-                                                ((u32)mac[1]));
+       mac_update.mac_upper = FM10K_CPU_TO_LE16(((u16)mac[0] << 8) |
+                                          ((u16)mac[1]));
        mac_update.vlan = FM10K_CPU_TO_LE16(vid);
        mac_update.glort = FM10K_CPU_TO_LE16(glort);
        mac_update.action = add ? 0 : 1;