__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.
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -11,8 +11,8 @@ · 10 unmodified lines | ||
| 11 | 11 | # define __iomem __attribute__((noderef, address_space(__iomem))) |
| 12 | 12 | # define __percpu __attribute__((noderef, address_space(__percpu))) |
| 13 | 13 | # define __rcu __attribute__((noderef, address_space(__rcu))) |
| 14 | −extern void __chk_user_ptr(const volatile void __user *); | |
| 15 | −extern void __chk_io_ptr(const volatile void __iomem *); | |
| 14 | +static inline void __chk_user_ptr(const volatile void __user *ptr) { } | |
| 15 | +static inline void __chk_io_ptr(const volatile void __iomem *ptr) { } | |
| 16 | 16 | /* context/locking */ |
| 17 | 17 | # define __must_hold(x) __attribute__((context(x,1,1))) |
| 18 | 18 | # define __acquires(x) __attribute__((context(x,0,1))) |