i40e: use explicit cast from u16 to u8
authorKamil Krawczyk <kamil.krawczyk@intel.com>
Thu, 19 Nov 2015 19:34:19 +0000 (11:34 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sun, 13 Dec 2015 05:08:26 +0000 (21:08 -0800)
Current implementation generates compilation warnings.

Change-ID: Icceefb50fe62aefaf90a64afb7192e08355a4ec5
Signed-off-by: Kamil Krawczyk <kamil.krawczyk@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c

index 79ae7beeafe5afa17531083ba8e933fb15a43f9b..daa9204426d42b9cc74749800d62413bc0ddbf5a 100644 (file)
@@ -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;