Commit 9795302acf2817d0842e56d23df6008e43df0970

Authored by Mathieu Desnoyers
Committed by Ingo Molnar
1 parent 611b159768

tracepoints: use TABLE_SIZE macro

Steven Rostedt suggested:

| Wouldn't it look nicer to have: (TRACEPOINT_TABLE_SIZE - 1) ?

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff

... ... @@ -177,7 +177,7 @@
177 177 struct tracepoint_entry *e;
178 178 u32 hash = jhash(name, strlen(name), 0);
179 179  
180   - head = &tracepoint_table[hash & ((1 << TRACEPOINT_HASH_BITS)-1)];
  180 + head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)];
181 181 hlist_for_each_entry(e, node, head, hlist) {
182 182 if (!strcmp(name, e->name))
183 183 return e;
... ... @@ -197,7 +197,7 @@
197 197 size_t name_len = strlen(name) + 1;
198 198 u32 hash = jhash(name, name_len-1, 0);
199 199  
200   - head = &tracepoint_table[hash & ((1 << TRACEPOINT_HASH_BITS)-1)];
  200 + head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)];
201 201 hlist_for_each_entry(e, node, head, hlist) {
202 202 if (!strcmp(name, e->name)) {
203 203 printk(KERN_NOTICE
... ... @@ -233,7 +233,7 @@
233 233 size_t len = strlen(name) + 1;
234 234 u32 hash = jhash(name, len-1, 0);
235 235  
236   - head = &tracepoint_table[hash & ((1 << TRACEPOINT_HASH_BITS)-1)];
  236 + head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)];
237 237 hlist_for_each_entry(e, node, head, hlist) {
238 238 if (!strcmp(name, e->name)) {
239 239 found = 1;