Re: [PATCH] fs/binfmt_elf.c: fix a do-while statement.

From: Thiago Farina
Date: Tue Jan 26 2010 - 20:44:38 EST


Hi Andrew,

On Tue, Jan 26, 2010 at 10:06 PM, Andrew Morton
<akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Wed, 20 Jan 2010 23:03:53 -0500
> Thiago Farina <tfransosi@xxxxxxxxx> wrote:
>
>> warning: do-while statement is not a compound statement
>>
>> Signed-off-by: Thiago Farina <tfransosi@xxxxxxxxx>
>> ---
>> Âfs/binfmt_elf.c | Â Â4 ++--
>> Â1 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)
>> Â{
>> Â Â Â elf_addr_t *auxv = (elf_addr_t *) mm->saved_auxv;
>> Â Â Â int i = 0;
>> - Â Â do
>> + Â Â do {
>> Â Â Â Â Â Â Â i += 2;
>> - Â Â while (auxv[i - 2] != AT_NULL);
>> + Â Â } while (auxv[i - 2] != AT_NULL);
>> Â Â Â fill_note(note, "CORE", NT_AUXV, i * sizeof(elf_addr_t), auxv);
>> Â}
>
> hmpf. ÂWhich tool emitted that warning? Âsparse?
>
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 tree.
>
> But IMO it's such a minor thing that once it _is_ in the tree, it's not
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/