From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id B92025424 for ; Thu, 12 Jan 2017 15:08:46 +0100 (CET) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP; 12 Jan 2017 06:08:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,349,1477983600"; d="scan'208";a="48155834" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by orsmga004.jf.intel.com with ESMTP; 12 Jan 2017 06:08:44 -0800 Received: from pgsmsx106.gar.corp.intel.com ([169.254.9.2]) by KMSMSX151.gar.corp.intel.com ([169.254.10.189]) with mapi id 14.03.0248.002; Thu, 12 Jan 2017 22:08:43 +0800 From: "Dai, Wei" To: "Yigit, Ferruh" , "dev@dpdk.org" CC: "Zhang, Helin" , "Ananyev, Konstantin" Thread-Topic: [dpdk-dev] [PATCH 2/7] net/ixgbe/base: remove a compiler warning Thread-Index: AQHSa1koBtRHSwfTTU2FpoqtgzTsqaEy5KOAgAH6fAA= Date: Thu, 12 Jan 2017 14:08:42 +0000 Message-ID: <49759EB36A64CF4892C1AFEC9231E8D63A3275EF@PGSMSX106.gar.corp.intel.com> References: <1484063146-15796-1-git-send-email-wei.dai@intel.com> <1484063146-15796-3-git-send-email-wei.dai@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDQ4ZmVmYWItZjRlMy00MTg4LWI4NTQtYmIyZjZhYzgzYmYyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IngrVHRJelZzcU56M1V4T1oweXlCdk1jWFNTNVI0SUVRTnNlRGdaQ3hYRDg9In0= x-ctpclassification: CTP_IC x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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:08:47 -0000 > -----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 war= ning >=20 > On 1/10/2017 3:45 PM, Wei Dai wrote: > > This patch fixes a compiler warning. >=20 > I guess compiler warning is because of "mac->led_link_act =3D i;", since > led_link_act is 8bits.. >=20 > 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.=20 Whether the variable i is defined as u8 or u16, there is no compile warnin= g.=20 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 =3D 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 com= piler. Anyway, to define i as u8 is better than u16 and we had better keep aligned= with them. >=20 > > > > 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 =3D &hw->mac; > > u32 led_reg, led_mode; > > - u16 i; > > + u8 i; > > > > led_reg =3D IXGBE_READ_REG(hw, IXGBE_LEDCTL); > > > >