diff options
author | Jens Axboe <axboe@kernel.dk> | 2017-11-05 08:52:21 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-11-05 08:52:21 -0700 |
commit | dae2f95b38eeaaa3c4c5b350dd759f482802c2c9 (patch) | |
tree | 4b55287f760a1c18d13054121341859a80a07c3f | |
parent | cca113f2fe0759b91fd6a0e10fdcda2c28f18a7e (diff) | |
download | blktrace-dae2f95b38eeaaa3c4c5b350dd759f482802c2c9.tar.gz blktrace-dae2f95b38eeaaa3c4c5b350dd759f482802c2c9.tar.bz2 |
jhash: fix annoying gcc fall through warnings
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | jhash.h | 34 |
1 files changed, 16 insertions, 18 deletions
@@ -73,22 +73,21 @@ static inline u32 jhash(const void *key, u32 length, u32 initval) k += 12; } - /* last block: affect all 32 bits of (c) */ - /* all the case statements fall through */ + /* Last block: affect all 32 bits of (c) */ switch (length) { - case 12: c += (u32)k[11]<<24; - case 11: c += (u32)k[10]<<16; - case 10: c += (u32)k[9]<<8; - case 9 : c += k[8]; - case 8 : b += (u32)k[7]<<24; - case 7 : b += (u32)k[6]<<16; - case 6 : b += (u32)k[5]<<8; - case 5 : b += k[4]; - case 4 : a += (u32)k[3]<<24; - case 3 : a += (u32)k[2]<<16; - case 2 : a += (u32)k[1]<<8; - case 1 : a += k[0]; - __jhash_final(a, b, c); + case 12: c += (u32)k[11]<<24; /* fall through */ + case 11: c += (u32)k[10]<<16; /* fall through */ + case 10: c += (u32)k[9]<<8; /* fall through */ + case 9: c += k[8]; /* fall through */ + case 8: b += (u32)k[7]<<24; /* fall through */ + case 7: b += (u32)k[6]<<16; /* fall through */ + case 6: b += (u32)k[5]<<8; /* fall through */ + case 5: b += k[4]; /* fall through */ + case 4: a += (u32)k[3]<<24; /* fall through */ + case 3: a += (u32)k[2]<<16; /* fall through */ + case 2: a += (u32)k[1]<<8; /* fall through */ + case 1: a += k[0]; + __jhash_final(a, b, c); case 0 : break; } @@ -117,10 +116,9 @@ static inline u32 jhash2(u32 *k, u32 length, u32 initval) } /* handle the last 3 u32's */ - /* all the case statements fall through */ switch (length) { - case 3: c += k[2]; - case 2: b += k[1]; + case 3: c += k[2]; /* fall through */ + case 2: b += k[1]; /* fall through */ case 1: a += k[0]; __jhash_final(a, b, c); case 0: /* case 0: nothing left to add */ |