All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sparse: use static inline for __chk_{user,io}_ptr()
@ 2020-08-28  8:53 Luc Van Oostenryck
  2020-08-28 11:15   ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
                   ` (11 more replies)
  0 siblings, 12 replies; 32+ messages in thread
From: Luc Van Oostenryck @ 2020-08-28  8:53 UTC (permalink / raw)
  To: Miguel Ojeda; +Cc: linux-kernel, Luc Van Oostenryck

__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: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 include/linux/compiler_types.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


Hi Miguel,

Could you also take this patch in your queue?
It has already be sent twice but ignored by the other channels.

Many thanks,
-- Luc

diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index aaa6f051e78e..01bc5e5ae06c 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -11,8 +11,8 @@
 # define __iomem	__attribute__((noderef, address_space(__iomem)))
 # define __percpu	__attribute__((noderef, address_space(__percpu)))
 # define __rcu		__attribute__((noderef, address_space(__rcu)))
-extern void __chk_user_ptr(const volatile void __user *);
-extern void __chk_io_ptr(const volatile void __iomem *);
+static inline void __chk_user_ptr(const volatile void __user *ptr) { }
+static inline void __chk_io_ptr(const volatile void __iomem *ptr) { }
 /* context/locking */
 # define __must_hold(x)	__attribute__((context(x,1,1)))
 # define __acquires(x)	__attribute__((context(x,0,1)))

base-commit: 9123e3a74ec7b934a4a099e98af6a61c2f80bbf5
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 32+ messages in thread
* [PATCH] sparse: use static inline for __chk_{user,io}_ptr()
@ 2020-06-28  7:20 Luc Van Oostenryck
  2020-06-29 17:12   ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
                   ` (3 more replies)
  0 siblings, 4 replies; 32+ messages in thread
From: Luc Van Oostenryck @ 2020-06-28  7:20 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Luc Van Oostenryck

__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: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 include/linux/compiler_types.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index b67930216e45..a9b6699f3934 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -11,8 +11,8 @@
 # define __iomem	__attribute__((noderef, address_space(__iomem)))
 # define __percpu	__attribute__((noderef, address_space(__percpu)))
 # define __rcu		__attribute__((noderef, address_space(__rcu)))
-extern void __chk_user_ptr(const volatile void __user *);
-extern void __chk_io_ptr(const volatile void __iomem *);
+static inline void __chk_user_ptr(const volatile void __user *ptr) { }
+static inline void __chk_io_ptr(const volatile void __iomem *ptr) { }
 /* context/locking */
 # define __must_hold(x)	__attribute__((context(x,1,1)))
 # define __acquires(x)	__attribute__((context(x,0,1)))
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2020-09-03  4:06 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-28  8:53 [PATCH] sparse: use static inline for __chk_{user,io}_ptr() Luc Van Oostenryck
2020-08-28 11:15 ` kernel test robot
2020-08-28 11:15   ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
2020-08-28 11:37 ` [PATCH] sparse: use static inline for __chk_{user,io}_ptr() kernel test robot
2020-08-28 11:37   ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
2020-08-28 12:20 ` [PATCH] sparse: use static inline for __chk_{user,io}_ptr() kernel test robot
2020-08-28 12:20   ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
2020-08-28 14:21 ` [PATCH] sparse: use static inline for __chk_{user,io}_ptr() kernel test robot
2020-08-28 14:21   ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
2020-08-28 15:11 ` [PATCH] sparse: use static inline for __chk_{user,io}_ptr() kernel test robot
2020-08-28 15:11   ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
2020-08-28 19:04 ` [PATCH] sparse: use static inline for __chk_{user,io}_ptr() Miguel Ojeda
2020-08-28 20:15   ` Luc Van Oostenryck
2020-08-29  7:33     ` Miguel Ojeda
2020-09-01  0:57 ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
2020-09-01  5:33 ` kernel test robot
2020-09-01 21:37 ` kernel test robot
2020-09-02  1:12 ` kernel test robot
2020-09-03  2:56 ` kernel test robot
2020-09-03  4:06 ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2020-06-28  7:20 [PATCH] sparse: use static inline for __chk_{user,io}_ptr() Luc Van Oostenryck
2020-06-29 17:12 ` kernel test robot
2020-06-29 17:12   ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
2020-06-29 18:08 ` [PATCH] sparse: use static inline for __chk_{user,io}_ptr() kernel test robot
2020-06-29 18:08   ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
2020-06-29 18:37   ` [PATCH] sparse: use static inline for __chk_{user,io}_ptr() Luc Van Oostenryck
2020-06-29 18:37     ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() Luc Van Oostenryck
2020-06-30  0:31     ` Rong Chen
2020-06-30 11:58 ` [PATCH] sparse: use static inline for __chk_{user,io}_ptr() kernel test robot
2020-06-30 11:58   ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
2020-07-01 18:35 ` [PATCH] sparse: use static inline for __chk_{user,io}_ptr() kernel test robot
2020-07-01 18:35   ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.