lkml.org 
[lkml]   [2018]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 1/2] static_call: fix out-of-line static call implementation
Date
Actually call __static_call_update() from static_call_update(), and fix the
former so it can actually compile. Also make it update key.func.

Signed-off-by: Edward Cree <ecree@solarflare.com>
---
include/linux/static_call.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/static_call.h b/include/linux/static_call.h
index 6daff586c97d..38d6c1e4c85d 100644
--- a/include/linux/static_call.h
+++ b/include/linux/static_call.h
@@ -153,16 +153,18 @@ struct static_call_key {

#define static_call(key, args...) STATIC_CALL_TRAMP(key)(args)

-#define __static_call_update(key, func) \
+#define __static_call_update(key, _func) \
({ \
cpus_read_lock(); \
- arch_static_call_transform(NULL, key->tramp, func); \
+ arch_static_call_transform(NULL, key.tramp, _func); \
+ WRITE_ONCE(key.func, _func); \
cpus_read_unlock(); \
})

#define static_call_update(key, func) \
({ \
BUILD_BUG_ON(!__same_type(func, STATIC_CALL_TRAMP(key))); \
+ __static_call_update(key, func); \
})

#define EXPORT_STATIC_CALL(key) \
\
 
 \ /
  Last update: 2018-12-12 18:50    [W:0.990 / U:0.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site