From: Damien Guibouret <damien.guibouret@partition-saving.com>
To: linux-ext4@vger.kernel.org
Cc: Damien Guibouret <damien.guibouret@partition-saving.com>
Subject: [PATCH] e2fsprogs - dirhash.c: remove useless test and assignment in strtohash
Date: Thu, 27 Jul 2017 22:53:54 +0200 [thread overview]
Message-ID: <1501188834-4499-1-git-send-email-damien.guibouret@partition-saving.com> (raw)
On transformation of str to hash, computed value is initialised before
first byte modulo 4. But it is already initialised before entering loop
and after processing last byte modulo 4. So the corresponding test and
initialisation could be removed.
Signed-off-by: Damien Guibouret <damien.guibouret@partition-saving.com>
---
lib/ext2fs/dirhash.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/lib/ext2fs/dirhash.c b/lib/ext2fs/dirhash.c
index c4ac94e..4ba3f35 100644
--- a/lib/ext2fs/dirhash.c
+++ b/lib/ext2fs/dirhash.c
@@ -154,8 +154,6 @@ static void str2hashbuf(const char *msg, int len, __u32 *buf, int num,
if (len > num*4)
len = num * 4;
for (i=0; i < len; i++) {
- if ((i % 4) == 0)
- val = pad;
if (unsigned_flag)
c = (int) ucp[i];
else
--
2.5.0
next reply other threads:[~2017-07-27 20:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-27 20:53 Damien Guibouret [this message]
2017-09-07 13:39 ` e2fsprogs - dirhash.c: remove useless test and assignment in strtohash Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1501188834-4499-1-git-send-email-damien.guibouret@partition-saving.com \
--to=damien.guibouret@partition-saving.com \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).