lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 27 May 2007 22:53:26 -0400 (EDT)
From:	"John Anthony Kazos Jr." <jakj@...-k-j.com>
To:	young dave <hidave.darkstar@...il.com>
cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [patch -mm 1/1] remove useless tolower in isofs

> Hi,
> Remove useless tolower in isofs
> 
> Signed-off-by: dave young <hidave.darkstar@...il.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.)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ