From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 95C4A2C3F for ; Fri, 1 Jul 2016 13:29:09 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 01 Jul 2016 04:29:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,556,1459839600"; d="scan'208";a="838625158" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by orsmga003.jf.intel.com with ESMTP; 01 Jul 2016 04:29:07 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.125]) by irsmsx110.ger.corp.intel.com ([163.33.3.25]) with mapi id 14.03.0248.002; Fri, 1 Jul 2016 12:29:05 +0100 From: "De Lara Guarch, Pablo" To: "Ma, Pengyu (Wind River)" , "thomas.monjalon@6wind.com" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] Fix misleading indentation in ethtool Thread-Index: AQHR04hkAVBDJti9KEaJ/0w8HQg/5aADa09w Date: Fri, 1 Jul 2016 11:29:05 +0000 Message-ID: References: <1467363156-70973-1-git-send-email-pengyu.ma@windriver.com> In-Reply-To: <1467363156-70973-1-git-send-email-pengyu.ma@windriver.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTFiYjA1YTQtMWUwMi00NTRlLTg0OTQtZDg2ZjcyNzcyZmZmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlNyV1ZSamdzUkhrZW9nSWJOdU8zWHZBMm5xdUtVMldKNkpGbjUzcjgxUEk9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] Fix misleading indentation in ethtool X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jul 2016 11:29:10 -0000 Hi Pengyu, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pengyu Ma > Sent: Friday, July 01, 2016 9:53 AM > To: thomas.monjalon@6wind.com; dev@dpdk.org > Subject: [dpdk-dev] [PATCH] Fix misleading indentation in ethtool You need to add the library that you are fixing in the title: i.e. kni: fix misleading identation in ethtool >=20 > gcc complains about: > build/lib/librte_eal/linuxapp/kni/e1000_phy.c:3303:2: > error: this 'if' clause does not guard... [-Werror=3Dmisleading-indentati= on] Could you tell me which gcc version you are using? >=20 > Code indentation is misleadingly indented as whether > the following content is guarded by if or not. > With the reference of the context, add the curly braces. >=20 > Remove unused const variables too. You are fixing part of a library, so you should add a fixes line here. Please refer to the following document to know how to do it: http://dpdk.readthedocs.io/en/v16.04/contributing/patches.html >=20 > Signed-off-by: Pengyu Ma > --- > lib/librte_eal/linuxapp/kni/ethtool/igb/e1000_phy.c | 9 ++++++--- > lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_82599.c | 8 +++++--- > lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c | 5 +++++ > 3 files changed, 16 insertions(+), 6 deletions(-) >=20 > diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/e1000_phy.c > b/lib/librte_eal/linuxapp/kni/ethtool/igb/e1000_phy.c > index df22470..120e57b 100644 > --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/e1000_phy.c > +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/e1000_phy.c > @@ -3300,12 +3300,13 @@ s32 e1000_read_phy_reg_mphy(struct e1000_hw > *hw, u32 address, u32 *data) > *data =3D E1000_READ_REG(hw, E1000_MPHY_DATA); >=20 > /* Disable access to mPHY if it was originally disabled */ > - if (locked) > + if (locked) { > ready =3D e1000_is_mphy_ready(hw); > if (!ready) > return -E1000_ERR_PHY; > E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, > E1000_MPHY_DIS_ACCESS); > + } You are actually fixing the code flow, right? So, not sure if you should modify the title and body of the patch. >=20 > return E1000_SUCCESS; > } > @@ -3365,12 +3366,14 @@ s32 e1000_write_phy_reg_mphy(struct > e1000_hw *hw, u32 address, u32 data, > E1000_WRITE_REG(hw, E1000_MPHY_DATA, data); >=20 > /* Disable access to mPHY if it was originally disabled */ > - if (locked) > + if (locked) { > ready =3D e1000_is_mphy_ready(hw); > - if (!ready) > + if (!ready) { > return -E1000_ERR_PHY; > + } Not needed it, but harmless :) > E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, > E1000_MPHY_DIS_ACCESS); > + } >=20 > return E1000_SUCCESS; > } > diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_82599.c > b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_82599.c > index 017dfe1..71cbf1a 100644 > --- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_82599.c > +++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_82599.c > @@ -867,14 +867,16 @@ s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw > *hw, > link_mode =3D=3D IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) { > /* Set KX4/KX/KR support according to speed requested */ > autoc &=3D ~(IXGBE_AUTOC_KX4_KX_SUPP_MASK | > IXGBE_AUTOC_KR_SUPP); > - if (speed & IXGBE_LINK_SPEED_10GB_FULL) > + if (speed & IXGBE_LINK_SPEED_10GB_FULL) { > if (orig_autoc & IXGBE_AUTOC_KX4_SUPP) > autoc |=3D IXGBE_AUTOC_KX4_SUPP; > if ((orig_autoc & IXGBE_AUTOC_KR_SUPP) && > - (hw->phy.smart_speed_active =3D=3D false)) > + (hw->phy.smart_speed_active =3D=3D false)) > autoc |=3D IXGBE_AUTOC_KR_SUPP; > - if (speed & IXGBE_LINK_SPEED_1GB_FULL) > + } > + if (speed & IXGBE_LINK_SPEED_1GB_FULL) { > autoc |=3D IXGBE_AUTOC_KX_SUPP; > + } > } else if ((pma_pmd_1g =3D=3D IXGBE_AUTOC_1G_SFI) && > (link_mode =3D=3D IXGBE_AUTOC_LMS_1G_LINK_NO_AN || > link_mode =3D=3D IXGBE_AUTOC_LMS_1G_AN)) { > diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c > b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c > index 8c1d2fe..1e9f9d1 100644 > --- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c > +++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c > @@ -59,8 +59,11 @@ > #undef CONFIG_DCA_MODULE >=20 > char ixgbe_driver_name[] =3D "ixgbe"; > +/* > static const char ixgbe_driver_string[] =3D > "Intel(R) 10 Gigabit PCI Express Network Driver"; > +*/ This line and the one below that you are commenting out have been removed i= n this patch (http://dpdk.org/dev/patchwork/patch/14276/) and it has been applied, so no= need to touch this file :) Make sure that you rebase your patch against head before submitting a v2, t= o avoid this issue. > + > #define DRV_HW_PERF >=20 > #ifndef CONFIG_IXGBE_NAPI > @@ -79,8 +82,10 @@ static const char ixgbe_driver_string[] =3D > #define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \ > __stringify(BUILD) DRIVERNAPI DRV_HW_PERF FPGA > VMDQ_TAG > const char ixgbe_driver_version[] =3D DRV_VERSION; > +/* > static const char ixgbe_copyright[] =3D > "Copyright (c) 1999-2012 Intel Corporation."; > +*/ >=20 > /* ixgbe_pci_tbl - PCI Device ID Table > * > -- > 2.7.4