aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>2008-07-24 16:37:23 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-14 04:34:07 -0400
commit9795302acf2817d0842e56d23df6008e43df0970 (patch)
treede2219d52413770567e656b8e6e6b4da7fbf6fca
parent611b1597680dd4a57896bcca1af0484be463c55e (diff)
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>
-rw-r--r--kernel/tracepoint.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
index 42e86ddbd2a0..c7c62a4a75f5 100644
--- a/kernel/tracepoint.c
+++ b/kernel/tracepoint.c
@@ -177,7 +177,7 @@ static struct tracepoint_entry *get_tracepoint(const char *name)
177 struct tracepoint_entry *e; 177 struct tracepoint_entry *e;
178 u32 hash = jhash(name, strlen(name), 0); 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 hlist_for_each_entry(e, node, head, hlist) { 181 hlist_for_each_entry(e, node, head, hlist) {
182 if (!strcmp(name, e->name)) 182 if (!strcmp(name, e->name))
183 return e; 183 return e;
@@ -197,7 +197,7 @@ static struct tracepoint_entry *add_tracepoint(const char *name)
197 size_t name_len = strlen(name) + 1; 197 size_t name_len = strlen(name) + 1;
198 u32 hash = jhash(name, name_len-1, 0); 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 hlist_for_each_entry(e, node, head, hlist) { 201 hlist_for_each_entry(e, node, head, hlist) {
202 if (!strcmp(name, e->name)) { 202 if (!strcmp(name, e->name)) {
203 printk(KERN_NOTICE 203 printk(KERN_NOTICE
@@ -233,7 +233,7 @@ static int remove_tracepoint(const char *name)
233 size_t len = strlen(name) + 1; 233 size_t len = strlen(name) + 1;
234 u32 hash = jhash(name, len-1, 0); 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 hlist_for_each_entry(e, node, head, hlist) { 237 hlist_for_each_entry(e, node, head, hlist) {
238 if (!strcmp(name, e->name)) { 238 if (!strcmp(name, e->name)) {
239 found = 1; 239 found = 1;