Skip to content

Commit 9795302

Browse files
Mathieu DesnoyersIngo Molnar
authored andcommitted
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>
1 parent 611b159 commit 9795302

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎kernel/tracepoint.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static struct tracepoint_entry *get_tracepoint(const char *name)
177177
struct tracepoint_entry *e;
178178
u32 hash = jhash(name, strlen(name), 0);
179179

180-
head = &tracepoint_table[hash & ((1 << TRACEPOINT_HASH_BITS)-1)];
180+
head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)];
181181
hlist_for_each_entry(e, node, head, hlist) {
182182
if (!strcmp(name, e->name))
183183
return e;
@@ -197,7 +197,7 @@ static struct tracepoint_entry *add_tracepoint(const char *name)
197197
size_t name_len = strlen(name) + 1;
198198
u32 hash = jhash(name, name_len-1, 0);
199199

200-
head = &tracepoint_table[hash & ((1 << TRACEPOINT_HASH_BITS)-1)];
200+
head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)];
201201
hlist_for_each_entry(e, node, head, hlist) {
202202
if (!strcmp(name, e->name)) {
203203
printk(KERN_NOTICE
@@ -233,7 +233,7 @@ static int remove_tracepoint(const char *name)
233233
size_t len = strlen(name) + 1;
234234
u32 hash = jhash(name, len-1, 0);
235235

236-
head = &tracepoint_table[hash & ((1 << TRACEPOINT_HASH_BITS)-1)];
236+
head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)];
237237
hlist_for_each_entry(e, node, head, hlist) {
238238
if (!strcmp(name, e->name)) {
239239
found = 1;

0 commit comments

Comments
 (0)