From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markos Chandras Subject: Re: [PATCH] e1000/base: Add missing braces to the 'if' statements Date: Thu, 23 Jun 2016 11:34:21 +0100 Message-ID: <0d27e2a70097099e54fe9731f5950d93@suse.de> References: <20160623092552.30932-1-mchandras@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org To: Anupam Kapoor Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by dpdk.org (Postfix) with ESMTP id 464166CD5 for ; Thu, 23 Jun 2016 12:34:22 +0200 (CEST) In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Anupam, I have seen your commit, but my patch fixes a different file (although=20 the fix is similar). Am I missing something? On 2016-06-23 11:26, Anupam Kapoor wrote: > hi markos, >=20 > please see : cba50f6be0db9efdf694dcf4bce4a6945a275182, which should=20 > already > fix this. >=20 > -- > thanks > anupam >=20 >=20 > On Thu, Jun 23, 2016 at 2:55 PM, Markos Chandras =20 > wrote: >=20 >> Add the missing braces to the 'if' statements to fix the misleading >> identation. This also fixes the following build errors when building >> with gcc >=3D 6: >>=20 >> drivers/net/e1000/base/e1000_phy.c:4156:2: >> error: this 'if' clause does not guard...=20 >> [-Werror=3Dmisleading-indentation] >> if (locked) >> ^~ >>=20 >> drivers/net/e1000/base/e1000_phy.c:4158:3: >> note: ...this statement, but the latter is misleadingly indented as if= =20 >> it >> is guarded by the 'if' >> if (!ready) >> ^~ >>=20 >> drivers/net/e1000/base/e1000_phy.c: In function=20 >> 'e1000_write_phy_reg_mphy': >> drivers/net/e1000/base/e1000_phy.c:4221:2: >> error: this 'if' clause does not guard...=20 >> [-Werror=3Dmisleading-indentation] >> if (locked) >> ^~ >>=20 >> drivers/net/e1000/base/e1000_phy.c:4223:3: >> note: ...this statement, but the latter is misleadingly indented as if= =20 >> it >> is guarded by the 'if' >> if (!ready) >> ^~ >>=20 >> Signed-off-by: Markos Chandras >> --- >> drivers/net/e1000/base/e1000_phy.c | 6 ++++-- >> 1 file changed, 4 insertions(+), 2 deletions(-) >>=20 >> diff --git a/drivers/net/e1000/base/e1000_phy.c >> b/drivers/net/e1000/base/e1000_phy.c >> index d43b7ce..33f478b 100644 >> --- a/drivers/net/e1000/base/e1000_phy.c >> +++ b/drivers/net/e1000/base/e1000_phy.c >> @@ -4153,12 +4153,13 @@ s32 e1000_read_phy_reg_mphy(struct e1000_hw=20 >> *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); >> + } >>=20 >> return E1000_SUCCESS; >> } >> @@ -4218,12 +4219,13 @@ s32 e1000_write_phy_reg_mphy(struct e1000_hw=20 >> *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) >> return -E1000_ERR_PHY; >> E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, >> E1000_MPHY_DIS_ACCESS); >> + } >>=20 >> return E1000_SUCCESS; >> } >> -- >> 2.8.4 >>=20 >>=20 --=20 SUSE LINUX GmbH | GF: Felix Imend=C3=B6rffer, Jane Smithard, Graham Norto= n HRB 21284 (AG N=C3=BCrnberg) Maxfeldstr. 5, D-90409, N=C3=BCrnberg