diff options
Diffstat (limited to 'net/ceph/ceph_hash.c')
| -rw-r--r-- | net/ceph/ceph_hash.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/net/ceph/ceph_hash.c b/net/ceph/ceph_hash.c index 67bb1f11e613..16a47c0eef37 100644 --- a/net/ceph/ceph_hash.c +++ b/net/ceph/ceph_hash.c @@ -4,7 +4,7 @@ /* * Robert Jenkin's hash function. - * http://burtleburtle.net/bob/hash/evahash.html + * https://burtleburtle.net/bob/hash/evahash.html * This is in the public domain. */ #define mix(a, b, c) \ @@ -47,28 +47,38 @@ unsigned int ceph_str_hash_rjenkins(const char *str, unsigned int length) /* handle the last 11 bytes */ c = c + length; - switch (len) { /* all the case statements fall through */ + switch (len) { case 11: c = c + ((__u32)k[10] << 24); + fallthrough; case 10: c = c + ((__u32)k[9] << 16); + fallthrough; case 9: c = c + ((__u32)k[8] << 8); /* the first byte of c is reserved for the length */ + fallthrough; case 8: b = b + ((__u32)k[7] << 24); + fallthrough; case 7: b = b + ((__u32)k[6] << 16); + fallthrough; case 6: b = b + ((__u32)k[5] << 8); + fallthrough; case 5: b = b + k[4]; + fallthrough; case 4: a = a + ((__u32)k[3] << 24); + fallthrough; case 3: a = a + ((__u32)k[2] << 16); + fallthrough; case 2: a = a + ((__u32)k[1] << 8); + fallthrough; case 1: a = a + k[0]; /* case 0: nothing left to add */ |
