History

static keys: Inline the static_key_enabled() function

In the jump label enabled case, calling static_key_enabled() results in a function call. The function returns the results of a compare, so it really doesn't need the overhead of a full function call. Let's make it 'static inline' for both the jump label enabled and disabled cases.

Jason Baron committed 14 years ago

Commit 8eedce91 parent a706d4f2 files · +5 −12Browse files

Showing the changes to kernel (1 of 2 files). Show all

Unified · Split

kernel/jump_label.c+0−6
@@ -29,12 +29,6 @@ void jump_label_unlock(void) · 28 unmodified lines
2929 mutex_unlock(&jump_label_mutex);
3030 }
3131
32−bool static_key_enabled(struct static_key *key)
33−{
34− return (atomic_read(&key->enabled) > 0);
35−}
36−EXPORT_SYMBOL_GPL(static_key_enabled);
37−
3832 static int jump_label_cmp(const void *a, const void *b)
3933 {
4034 const struct jump_entry *jea = a;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t