diff options
author | Cong Ding <dinggnu@gmail.com> | 2013-02-02 04:33:21 +0100 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-02-02 04:33:21 +0100 |
commit | 0e79537d30f9dd66ccef70f1c7571594088e30be (patch) | |
tree | 584573b9c36dde6f07756a6d57cb8c7065c959fd /fs/ext4/hash.c | |
parent | ext4: fix race in ext4_mb_add_n_trim() (diff) | |
download | linux-0e79537d30f9dd66ccef70f1c7571594088e30be.tar.xz linux-0e79537d30f9dd66ccef70f1c7571594088e30be.zip |
ext4: reduce one "if" comparison in ext4_dirhash()
It is unnecessary to check i<4 after the loop; just do it before the
break.
Signed-off-by: Cong Ding <dinggnu@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to '')
-rw-r--r-- | fs/ext4/hash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ext4/hash.c b/fs/ext4/hash.c index fa8e4911d354..3d586f02883e 100644 --- a/fs/ext4/hash.c +++ b/fs/ext4/hash.c @@ -155,11 +155,11 @@ int ext4fs_dirhash(const char *name, int len, struct dx_hash_info *hinfo) /* Check to see if the seed is all zero's */ if (hinfo->seed) { for (i = 0; i < 4; i++) { - if (hinfo->seed[i]) + if (hinfo->seed[i]) { + memcpy(buf, hinfo->seed, sizeof(buf)); break; + } } - if (i < 4) - memcpy(buf, hinfo->seed, sizeof(buf)); } switch (hinfo->hash_version) { |