Message ID | 20180806224916.GY29662@ovn.org |
---|---|
State | Not Applicable |
Headers | show |
Series | [ovs-dev] project idea for someone: hash function sensitivity | expand |
Bleep bloop. Greetings Ben Pfaff, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. checkpatch: ERROR: No signatures found. Lines checked: 101, Warnings: 0, Errors: 1 Please check this out. If you feel there has been an error, please email aconole@bytheb.org Thanks, 0-day Robot
diff --git a/lib/hash.h b/lib/hash.h index a642a1e97954..30aeb6de5d38 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -87,7 +87,7 @@ static inline uint32_t mhash_finish(uint32_t hash) hash ^= hash >> 13; hash *= 0xc2b2ae35; hash ^= hash >> 16; - return hash; + return ~hash; } static inline uint32_t hash_add(uint32_t hash, uint32_t data); @@ -350,7 +350,7 @@ static inline uint32_t hash_boolean(bool x, uint32_t basis) { const uint32_t P0 = 0xc2b73583; /* This is hash_int(1, 0). */ const uint32_t P1 = 0xe90f1258; /* This is hash_int(2, 0). */ - return (x ? P0 : P1) ^ hash_rot(basis, 1); + return ~(x ? P0 : P1) ^ hash_rot(basis, 1); } /* Helper functions for calling hash_add() for several 32- or 64-bit words in a