From 7d9bf52c87a9f7ea017a9e0f82343d14e9cd724e Mon Sep 17 00:00:00 2001 From: Xiao Wang Date: Fri, 19 Feb 2016 19:06:49 +0800 Subject: [PATCH] fm10k/base: fix typecast 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 Tested-by: Heng Ding Acked-by: Jing Chen --- drivers/net/fm10k/base/fm10k_pf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/fm10k/base/fm10k_pf.c b/drivers/net/fm10k/base/fm10k_pf.c index 6e6d71ed91..4a028f342d 100644 --- a/drivers/net/fm10k/base/fm10k_pf.c +++ b/drivers/net/fm10k/base/fm10k_pf.c @@ -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; -- 2.20.1