diff options
author | Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | 2008-07-24 20:37:23 (GMT) |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-14 08:34:07 (GMT) |
commit | 9795302acf2817d0842e56d23df6008e43df0970 (patch) | |
tree | de2219d52413770567e656b8e6e6b4da7fbf6fca /kernel/tracepoint.c | |
parent | 611b1597680dd4a57896bcca1af0484be463c55e (diff) | |
download | linux-9795302acf2817d0842e56d23df6008e43df0970.tar.xz |
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>
Diffstat (limited to 'kernel/tracepoint.c')
-rw-r--r-- | kernel/tracepoint.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c index 42e86dd..c7c62a4 100644 --- a/kernel/tracepoint.c +++ b/kernel/tracepoint.c @@ -177,7 +177,7 @@ static struct tracepoint_entry *get_tracepoint(const char *name) struct tracepoint_entry *e; u32 hash = jhash(name, strlen(name), 0); - head = &tracepoint_table[hash & ((1 << TRACEPOINT_HASH_BITS)-1)]; + head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)]; hlist_for_each_entry(e, node, head, hlist) { if (!strcmp(name, e->name)) return e; @@ -197,7 +197,7 @@ static struct tracepoint_entry *add_tracepoint(const char *name) size_t name_len = strlen(name) + 1; u32 hash = jhash(name, name_len-1, 0); - head = &tracepoint_table[hash & ((1 << TRACEPOINT_HASH_BITS)-1)]; + head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)]; hlist_for_each_entry(e, node, head, hlist) { if (!strcmp(name, e->name)) { printk(KERN_NOTICE @@ -233,7 +233,7 @@ static int remove_tracepoint(const char *name) size_t len = strlen(name) + 1; u32 hash = jhash(name, len-1, 0); - head = &tracepoint_table[hash & ((1 << TRACEPOINT_HASH_BITS)-1)]; + head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)]; hlist_for_each_entry(e, node, head, hlist) { if (!strcmp(name, e->name)) { found = 1; |