* [patch -mm 1/1] remove useless tolower in isofs
@ 2007-05-28 1:08 young dave
2007-05-28 2:53 ` John Anthony Kazos Jr.
2007-05-28 6:00 ` Pekka Enberg
0 siblings, 2 replies; 9+ messages in thread
From: young dave @ 2007-05-28 1:08 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel Mailing List
Hi,
Remove useless tolower in isofs
Signed-off-by: dave young <hidave.darkstar@gmail.com>
inode.c | 2 +-
1 file changed, 1 insertions(+), 1 deletions(-)
diff -dur linux/fs/isofs/inode.c linux.new/fs/isofs/inode.c
--- linux/fs/isofs/inode.c 2007-05-28 08:54:33.000000000 +0000
+++ linux.new/fs/isofs/inode.c 2007-05-28 08:55:02.000000000 +0000
@@ -197,7 +197,7 @@
hash = init_name_hash();
while (len--) {
c = tolower(*name++);
- hash = partial_name_hash(tolower(c), hash);
+ hash = partial_name_hash(c, hash);
}
qstr->hash = end_name_hash(hash);
Regards
dave
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [patch -mm 1/1] remove useless tolower in isofs
2007-05-28 1:08 [patch -mm 1/1] remove useless tolower in isofs young dave
@ 2007-05-28 2:53 ` John Anthony Kazos Jr.
2007-05-28 3:11 ` young dave
2007-05-28 6:00 ` Pekka Enberg
1 sibling, 1 reply; 9+ messages in thread
From: John Anthony Kazos Jr. @ 2007-05-28 2:53 UTC (permalink / raw)
To: young dave; +Cc: Andrew Morton, Linux Kernel Mailing List
> Hi,
> Remove useless tolower in isofs
>
> Signed-off-by: dave young <hidave.darkstar@gmail.com>
>
> inode.c | 2 +-
> 1 file changed, 1 insertions(+), 1 deletions(-)
>
> diff -dur linux/fs/isofs/inode.c linux.new/fs/isofs/inode.c
> --- linux/fs/isofs/inode.c 2007-05-28 08:54:33.000000000 +0000
> +++ linux.new/fs/isofs/inode.c 2007-05-28 08:55:02.000000000 +0000
> @@ -197,7 +197,7 @@
> hash = init_name_hash();
> while (len--) {
> c = tolower(*name++);
> - hash = partial_name_hash(tolower(c), hash);
> + hash = partial_name_hash(c, hash);
> }
> qstr->hash = end_name_hash(hash);
How about this? A lot more readable and doesn't even need an intermediate
value.
for (; len; len--, name++) {
hash = partial_name_hash(tolower(*name), hash);
}
Or if you don't think that way is more readable, how about this?
while (len) {
hash = partial_name_hash(tolower(*name), hash);
name++;
len--;
}
And then there's the supercompact form.
while (len--) {
hash = partial_name_hash(tolower(*name++), hash);
}
But I do not like the last one at all. The first one is the best, because
it clearly separates the condition and iteration parts of the expression,
while STILL being only three lines long. Or two, if you omit the braces.
(But you shouldn't.)
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [patch -mm 1/1] remove useless tolower in isofs
2007-05-28 2:53 ` John Anthony Kazos Jr.
@ 2007-05-28 3:11 ` young dave
2007-05-29 23:17 ` Andrew Morton
0 siblings, 1 reply; 9+ messages in thread
From: young dave @ 2007-05-28 3:11 UTC (permalink / raw)
To: John Anthony Kazos Jr.; +Cc: Andrew Morton, Linux Kernel Mailing List
Hi,
> And then there's the supercompact form.
>
> while (len--) {
> hash = partial_name_hash(tolower(*name++), hash);
> }
>
> But I do not like the last one at all. The first one is the best, because
> it clearly separates the condition and iteration parts of the expression,
> while STILL being only three lines long. Or two, if you omit the braces.
> (But you shouldn't.)
>
IMO, I like the last one, but I prefer to keep the original author's
one, I only remove the unnecessary tolower function.
What do you think about this , Andrew?
Regards
dave
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [patch -mm 1/1] remove useless tolower in isofs
2007-05-28 3:11 ` young dave
@ 2007-05-29 23:17 ` Andrew Morton
2007-05-30 0:20 ` young dave
0 siblings, 1 reply; 9+ messages in thread
From: Andrew Morton @ 2007-05-29 23:17 UTC (permalink / raw)
To: young dave; +Cc: John Anthony Kazos Jr., Linux Kernel Mailing List
On Mon, 28 May 2007 03:11:04 +0000
"young dave" <hidave.darkstar@gmail.com> wrote:
> Hi,
> > And then there's the supercompact form.
> >
> > while (len--) {
> > hash = partial_name_hash(tolower(*name++), hash);
> > }
> >
> > But I do not like the last one at all. The first one is the best, because
> > it clearly separates the condition and iteration parts of the expression,
> > while STILL being only three lines long. Or two, if you omit the braces.
> > (But you shouldn't.)
> >
>
> IMO, I like the last one, but I prefer to keep the original author's
> one, I only remove the unnecessary tolower function.
> What do you think about this , Andrew?
>
Don't care much. The code as it stands is suitably paranoid about
buggy implementations of tolower() which evaluate their arg more
than once ;)
Your email client replaces tabs with spaces.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch -mm 1/1] remove useless tolower in isofs
2007-05-28 1:08 [patch -mm 1/1] remove useless tolower in isofs young dave
2007-05-28 2:53 ` John Anthony Kazos Jr.
@ 2007-05-28 6:00 ` Pekka Enberg
2007-05-28 10:10 ` young dave
1 sibling, 1 reply; 9+ messages in thread
From: Pekka Enberg @ 2007-05-28 6:00 UTC (permalink / raw)
To: young dave; +Cc: Andrew Morton, Linux Kernel Mailing List
On 5/28/07, young dave <hidave.darkstar@gmail.com> wrote:
> Remove useless tolower in isofs
[snip]
> c = tolower(*name++);
> - hash = partial_name_hash(tolower(c), hash);
> + hash = partial_name_hash(c, hash);
Looks good to me.
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-05-30 5:32 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-28 1:08 [patch -mm 1/1] remove useless tolower in isofs young dave
2007-05-28 2:53 ` John Anthony Kazos Jr.
2007-05-28 3:11 ` young dave
2007-05-29 23:17 ` Andrew Morton
2007-05-30 0:20 ` young dave
2007-05-30 5:32 ` young dave
2007-05-28 6:00 ` Pekka Enberg
2007-05-28 10:10 ` young dave
2007-05-28 10:16 ` Pekka Enberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome