* [PATCH] fs/binfmt_elf.c: fix a do-while statement.
@ 2010-01-21 4:03 Thiago Farina
2010-01-21 6:22 ` Cong Wang
2010-01-27 0:06 ` Andrew Morton
0 siblings, 2 replies; 5+ messages in thread
From: Thiago Farina @ 2010-01-21 4:03 UTC (permalink / raw)
To: linux-kernel
Cc: Alexander Viro, Andrew Morton, Roland McGrath, WANG Cong,
Hugh Dickins, linux-fsdevel
warning: do-while statement is not a compound statement
Signed-off-by: Thiago Farina <tfransosi@gmail.com>
---
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);
}
--
1.6.6.243.gff6d2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] fs/binfmt_elf.c: fix a do-while statement.
2010-01-21 4:03 [PATCH] fs/binfmt_elf.c: fix a do-while statement Thiago Farina
@ 2010-01-21 6:22 ` Cong Wang
2010-01-27 0:06 ` Andrew Morton
1 sibling, 0 replies; 5+ messages in thread
From: Cong Wang @ 2010-01-21 6:22 UTC (permalink / raw)
To: Thiago Farina
Cc: linux-kernel, Alexander Viro, Andrew Morton, Roland McGrath,
Hugh Dickins, linux-fsdevel
Thiago Farina wrote:
> warning: do-while statement is not a compound statement
>
> Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Acked-by: WANG Cong <amwang@redhat.com>
> ---
> 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);
> }
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fs/binfmt_elf.c: fix a do-while statement.
2010-01-21 4:03 [PATCH] fs/binfmt_elf.c: fix a do-while statement Thiago Farina
2010-01-21 6:22 ` Cong Wang
@ 2010-01-27 0:06 ` Andrew Morton
2010-01-27 1:44 ` Thiago Farina
1 sibling, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2010-01-27 0:06 UTC (permalink / raw)
To: Thiago Farina
Cc: linux-kernel, Alexander Viro, Roland McGrath, WANG Cong,
Hugh Dickins, linux-fsdevel
On Wed, 20 Jan 2010 23:03:53 -0500
Thiago Farina <tfransosi@gmail.com> wrote:
> warning: do-while statement is not a compound statement
>
> Signed-off-by: Thiago Farina <tfransosi@gmail.com>
> ---
> 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?
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fs/binfmt_elf.c: fix a do-while statement.
2010-01-27 0:06 ` Andrew Morton
@ 2010-01-27 1:44 ` Thiago Farina
2010-01-27 2:07 ` Andrew Morton
0 siblings, 1 reply; 5+ messages in thread
From: Thiago Farina @ 2010-01-27 1:44 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, Alexander Viro, Roland McGrath, WANG Cong,
Hugh Dickins, linux-fsdevel
Hi Andrew,
On Tue, Jan 26, 2010 at 10:06 PM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Wed, 20 Jan 2010 23:03:53 -0500
> Thiago Farina <tfransosi@gmail.com> wrote:
>
>> warning: do-while statement is not a compound statement
>>
>> Signed-off-by: Thiago Farina <tfransosi@gmail.com>
>> ---
>> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fs/binfmt_elf.c: fix a do-while statement.
2010-01-27 1:44 ` Thiago Farina
@ 2010-01-27 2:07 ` Andrew Morton
0 siblings, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2010-01-27 2:07 UTC (permalink / raw)
To: Thiago Farina
Cc: linux-kernel, Alexander Viro, Roland McGrath, WANG Cong,
Hugh Dickins, linux-fsdevel
On Tue, 26 Jan 2010 23:44:29 -0200 Thiago Farina <tfransosi@gmail.com> wrote:
> > 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.
I'd be OK with fixing things like this as part of a larger
"fs/binfmt_elf.c: coding-style fixes" or "fs/*elf.c: ...", etc. One
big hit. It's the little dribble of one-line fixes which I'd prefer to
avoid.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-01-27 2:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-21 4:03 [PATCH] fs/binfmt_elf.c: fix a do-while statement Thiago Farina
2010-01-21 6:22 ` Cong Wang
2010-01-27 0:06 ` Andrew Morton
2010-01-27 1:44 ` Thiago Farina
2010-01-27 2:07 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).