diff mbox

[V3:,next,S22,06/12] i40e: use explicit cast from u16 to u8

Message ID 1447961665-12344-7-git-send-email-deepthi.kavalur@intel.com
State Accepted
Delegated to: Jeff Kirsher
Headers show

Commit Message

Deepthi Kavalur Nov. 19, 2015, 7:34 p.m. UTC
From: Kamil Krawczyk <kamil.krawczyk@intel.com>

Current implementation generates compilation warnings.

Signed-off-by: Kamil Krawczyk <kamil.krawczyk@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Change-ID: Icceefb50fe62aefaf90a64afb7192e08355a4ec5
---
 drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bowers, AndrewX Nov. 24, 2015, 10:55 p.m. UTC | #1
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@lists.osuosl.org] On
> Behalf Of Deepthi Kavalur
> Sent: Thursday, November 19, 2015 11:34 AM
> To: intel-wired-lan@lists.osuosl.org
> Cc: Krawczyk, Kamil <kamil.krawczyk@intel.com>
> Subject: [Intel-wired-lan] [V3: next PATCH S22 06/12] i40e: use explicit cast
> from u16 to u8
> 
> From: Kamil Krawczyk <kamil.krawczyk@intel.com>
> 
> Current implementation generates compilation warnings.
> 
> Signed-off-by: Kamil Krawczyk <kamil.krawczyk@intel.com>
> Acked-by: Shannon Nelson <shannon.nelson@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Change-ID: Icceefb50fe62aefaf90a64afb7192e08355a4ec5
> ---
>  drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Patch code changes correctly applied
diff mbox

Patch

diff --git a/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c b/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c
index 79ae7be..daa9204 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c
@@ -762,7 +762,7 @@  static void i40e_write_byte(u8 *hmc_bits,
 
 	/* prepare the bits and mask */
 	shift_width = ce_info->lsb % 8;
-	mask = BIT(ce_info->width) - 1;
+	mask = (u8)(BIT(ce_info->width) - 1);
 
 	src_byte = *from;
 	src_byte &= mask;