summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorDamien Guibouret <damien.guibouret@partition-saving.com>2017-08-24 15:11:34 -0400
committerTheodore Ts'o <tytso@mit.edu>2017-08-24 15:11:34 -0400
commit918dc9d0ab8565886de3ea8bac329e2b102e7f3a (patch)
tree54f1abe27e5909e25371332428baa301bdbad365 /fs/ext4
parenta6d05676047ec9ef7b98087f8b19a5283dd5a8ce (diff)
downloadlinux-918dc9d0ab8565886de3ea8bac329e2b102e7f3a.tar.bz2
ext4: remove useless test and assignment in strtohash functions
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> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/hash.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/ext4/hash.c b/fs/ext4/hash.c
index 38b8a96eb97c..00c6dd29e621 100644
--- a/fs/ext4/hash.c
+++ b/fs/ext4/hash.c
@@ -148,8 +148,6 @@ static void str2hashbuf_signed(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;
val = ((int) scp[i]) + (val << 8);
if ((i % 4) == 3) {
*buf++ = val;
@@ -176,8 +174,6 @@ static void str2hashbuf_unsigned(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;
val = ((int) ucp[i]) + (val << 8);
if ((i % 4) == 3) {
*buf++ = val;