Commit e5fc436f authored by Luc Van Oostenryck's avatar Luc Van Oostenryck Committed by Miguel Ojeda

sparse: use static inline for __chk_{user,io}_ptr()

__chk_user_ptr() & __chk_io_ptr() are dummy extern functions which
only exist to enforce the typechecking of __user or __iomem pointers
in macros when using sparse.

This typechecking is done by inserting a call to these functions.
But the presence of these calls can inhibit some simplifications
and so influence the result of sparse's analysis of context/locking.

Fix this by changing these calls into static inline calls with
an empty body.
Signed-off-by: default avatarLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: default avatarMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
parent 5861af92
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
# define __iomem __attribute__((noderef, address_space(__iomem))) # define __iomem __attribute__((noderef, address_space(__iomem)))
# define __percpu __attribute__((noderef, address_space(__percpu))) # define __percpu __attribute__((noderef, address_space(__percpu)))
# define __rcu __attribute__((noderef, address_space(__rcu))) # define __rcu __attribute__((noderef, address_space(__rcu)))
extern void __chk_user_ptr(const volatile void __user *); static inline void __chk_user_ptr(const volatile void __user *ptr) { }
extern void __chk_io_ptr(const volatile void __iomem *); static inline void __chk_io_ptr(const volatile void __iomem *ptr) { }
/* context/locking */ /* context/locking */
# define __must_hold(x) __attribute__((context(x,1,1))) # define __must_hold(x) __attribute__((context(x,1,1)))
# define __acquires(x) __attribute__((context(x,0,1))) # define __acquires(x) __attribute__((context(x,0,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