rcuja: allow non-power of 2 keys
[userspace-rcu.git] / rcuja / rcuja.c
index 407c101be65eeaecb98a45b70dad90a360bb81d8..db5072a2133f469672c2010df73e2485e09f2a57 100644 (file)
@@ -1422,13 +1422,13 @@ struct cds_ja *_cds_ja_new(unsigned int key_bits,
 
        switch (key_bits) {
        case 8:
-               ja->key_max = UINT8_MAX;
-               break;
        case 16:
-               ja->key_max = UINT16_MAX;
-               break;
+       case 24:
        case 32:
-               ja->key_max = UINT32_MAX;
+       case 40:
+       case 48:
+       case 56:
+               ja->key_max = (1ULL << key_bits) - 1;
                break;
        case 64:
                ja->key_max = UINT64_MAX;
This page took 0.022744 seconds and 4 git commands to generate.