i40e/base: fix compilation warnings
authorHelin Zhang <helin.zhang@intel.com>
Tue, 8 Mar 2016 08:14:09 +0000 (16:14 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 16 Mar 2016 16:21:44 +0000 (17:21 +0100)
Fix compilation warnings in base code on some platforms.

Fixes: bd6651c2d2d7 ("i40e/base: use bit shift macros")

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
drivers/net/i40e/base/i40e_lan_hmc.c

index 6511767..2260648 100644 (file)
@@ -769,7 +769,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;
@@ -954,7 +954,7 @@ static void i40e_read_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);
 
        /* shift to correct alignment */
        mask <<= shift_width;