From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thiago Farina Subject: Re: [PATCH] fs/binfmt_elf.c: fix a do-while statement. Date: Tue, 26 Jan 2010 23:44:29 -0200 Message-ID: References: <20100126160632.3bdbe172.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, Alexander Viro , Roland McGrath , WANG Cong , Hugh Dickins , linux-fsdevel@vger.kernel.org To: Andrew Morton Return-path: In-Reply-To: <20100126160632.3bdbe172.akpm@linux-foundation.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hi Andrew, On Tue, Jan 26, 2010 at 10:06 PM, Andrew Morton wrote: > On Wed, 20 Jan 2010 23:03:53 -0500 > Thiago Farina wrote: > >> warning: do-while statement is not a compound statement >> >> Signed-off-by: Thiago Farina >> --- >> =C2=A0fs/binfmt_elf.c | =C2=A0 =C2=A04 ++-- >> =C2=A01 files changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c >> index edd90c4..75d6468 100644 >> --- a/fs/binfmt_elf.c >> +++ b/fs/binfmt_elf.c >> @@ -1404,9 +1404,9 @@ static void fill_auxv_note(struct memelfnote *= note, struct mm_struct *mm) >> =C2=A0{ >> =C2=A0 =C2=A0 =C2=A0 elf_addr_t *auxv =3D (elf_addr_t *) mm->saved_a= uxv; >> =C2=A0 =C2=A0 =C2=A0 int i =3D 0; >> - =C2=A0 =C2=A0 do >> + =C2=A0 =C2=A0 do { >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 i +=3D 2; >> - =C2=A0 =C2=A0 while (auxv[i - 2] !=3D AT_NULL); >> + =C2=A0 =C2=A0 } while (auxv[i - 2] !=3D AT_NULL); >> =C2=A0 =C2=A0 =C2=A0 fill_note(note, "CORE", NT_AUXV, i * sizeof(elf= _addr_t), auxv); >> =C2=A0} > > hmpf. =C2=A0Which tool emitted that warning? =C2=A0sparse? > Yes, it is a sparse warning. > It is somewhat unconventional coding style and it'd be good if > checkpatch were to warn so that we don't _add_ such things to the tre= e. > > But IMO it's such a minor thing that once it _is_ in the tree, it's n= ot > really worth the patch noise to go and fix it up. Yeah, much noise for a small thing. I will not fix more warnings like this in future. -Thiago