From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 1CAEFD592 for ; Thu, 12 Jan 2017 15:24:26 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP; 12 Jan 2017 06:24:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,349,1477983600"; d="scan'208";a="52205205" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.38]) ([10.237.220.38]) by orsmga005.jf.intel.com with ESMTP; 12 Jan 2017 06:24:25 -0800 To: "Dai, Wei" , "dev@dpdk.org" References: <1484063146-15796-1-git-send-email-wei.dai@intel.com> <1484063146-15796-3-git-send-email-wei.dai@intel.com> <49759EB36A64CF4892C1AFEC9231E8D63A3275EF@PGSMSX106.gar.corp.intel.com> Cc: "Zhang, Helin" , "Ananyev, Konstantin" From: Ferruh Yigit Message-ID: <109611bd-cd54-2e65-fa5e-40455e5aaa99@intel.com> Date: Thu, 12 Jan 2017 14:24:24 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <49759EB36A64CF4892C1AFEC9231E8D63A3275EF@PGSMSX106.gar.corp.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 2/7] net/ixgbe/base: remove a compiler warning X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 14:24:27 -0000 On 1/12/2017 2:08 PM, Dai, Wei wrote: >> -----Original Message----- >> From: Yigit, Ferruh >> Sent: Wednesday, January 11, 2017 11:38 PM >> To: Dai, Wei ; dev@dpdk.org >> Cc: Zhang, Helin ; Ananyev, Konstantin >> >> Subject: Re: [dpdk-dev] [PATCH 2/7] net/ixgbe/base: remove a compiler warning >> >> On 1/10/2017 3:45 PM, Wei Dai wrote: >>> This patch fixes a compiler warning. >> >> I guess compiler warning is because of "mac->led_link_act = i;", since >> led_link_act is 8bits.. >> >> But can you please add the compile warning here, to make it more clear to >> understand what is the issue. > > I have compared the generated ixgbe_common.o both from "u16 i" and "u8 I" . > Two .o files are identical. > Whether the variable i is defined as u8 or u16, there is no compile warning. > The version of gcc version is 6.3.1 20161221 (Red Hat 6.3.1-1) (GCC). > If i is u16, mac->led_link_act = i; should generate a warning, but there is no. > It is a bit weird . > As you know, this code is provided by another Intel team. > I think that it will generate a warning when they build it with their C compiler. > Anyway, to define i as u8 is better than u16 and we had better keep aligned with them. Agreed, u8 is better. > >> >>> >>> Signed-off-by: Wei Dai >>> --- >>> drivers/net/ixgbe/base/ixgbe_common.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/net/ixgbe/base/ixgbe_common.c >>> b/drivers/net/ixgbe/base/ixgbe_common.c >>> index 18bb18c..0dd33b8 100644 >>> --- a/drivers/net/ixgbe/base/ixgbe_common.c >>> +++ b/drivers/net/ixgbe/base/ixgbe_common.c >>> @@ -1150,7 +1150,7 @@ s32 ixgbe_init_led_link_act_generic(struct >>> ixgbe_hw *hw) { >>> struct ixgbe_mac_info *mac = &hw->mac; >>> u32 led_reg, led_mode; >>> - u16 i; >>> + u8 i; >>> >>> led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); >>> >>> >