Commit 9795302a authored by Mathieu Desnoyers's avatar Mathieu Desnoyers Committed by Ingo Molnar

tracepoints: use TABLE_SIZE macro

Steven Rostedt suggested:

| Wouldn't it look nicer to have: (TRACEPOINT_TABLE_SIZE - 1) ?
Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 611b1597
...@@ -177,7 +177,7 @@ static struct tracepoint_entry *get_tracepoint(const char *name) ...@@ -177,7 +177,7 @@ static struct tracepoint_entry *get_tracepoint(const char *name)
struct tracepoint_entry *e; struct tracepoint_entry *e;
u32 hash = jhash(name, strlen(name), 0); 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) { hlist_for_each_entry(e, node, head, hlist) {
if (!strcmp(name, e->name)) if (!strcmp(name, e->name))
return e; return e;
...@@ -197,7 +197,7 @@ static struct tracepoint_entry *add_tracepoint(const char *name) ...@@ -197,7 +197,7 @@ static struct tracepoint_entry *add_tracepoint(const char *name)
size_t name_len = strlen(name) + 1; size_t name_len = strlen(name) + 1;
u32 hash = jhash(name, name_len-1, 0); 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) { hlist_for_each_entry(e, node, head, hlist) {
if (!strcmp(name, e->name)) { if (!strcmp(name, e->name)) {
printk(KERN_NOTICE printk(KERN_NOTICE
...@@ -233,7 +233,7 @@ static int remove_tracepoint(const char *name) ...@@ -233,7 +233,7 @@ static int remove_tracepoint(const char *name)
size_t len = strlen(name) + 1; size_t len = strlen(name) + 1;
u32 hash = jhash(name, len-1, 0); 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) { hlist_for_each_entry(e, node, head, hlist) {
if (!strcmp(name, e->name)) { if (!strcmp(name, e->name)) {
found = 1; found = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment