mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/5] compiler.h, kasan: Avoid duplicating __read_once_size_nocheck()
@ 2018-02-01 18:00 Andrey Ryabinin
  2018-02-01 18:00 ` [PATCH 2/5] compiler.h: Add read_word_at_a_time() function Andrey Ryabinin
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Andrey Ryabinin @ 2018-02-01 18:00 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Linus Torvalds, Rasmus Villemoes, linux-kernel, Dmitry Vyukov,
	Kees Cook, Eryu Guan, Alexander Potapenko, Chris Metcalf,
	David Laight, kasan-dev, Alexander Viro, Andrey Ryabinin

Instead of having two identical __read_once_size_nocheck() functions
with different attributes, consolidate all the difference in new macro
__no_kasan_or_inline and use it. No functional changes.

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 include/linux/compiler.h | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 97847f2f86cf..b8414ecf9ba1 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -190,23 +190,21 @@ void __read_once_size(const volatile void *p, void *res, int size)
 
 #ifdef CONFIG_KASAN
 /*
- * This function is not 'inline' because __no_sanitize_address confilcts
+ * We can't declare function 'inline' because __no_sanitize_address confilcts
  * with inlining. Attempt to inline it may cause a build failure.
  * 	https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
  * '__maybe_unused' allows us to avoid defined-but-not-used warnings.
  */
-static __no_sanitize_address __maybe_unused
-void __read_once_size_nocheck(const volatile void *p, void *res, int size)
-{
-	__READ_ONCE_SIZE;
-}
+# define __no_kasan_or_inline __no_sanitize_address __maybe_unused
 #else
-static __always_inline
+# define __no_kasan_or_inline __always_inline
+#endif
+
+static __no_kasan_or_inline
 void __read_once_size_nocheck(const volatile void *p, void *res, int size)
 {
 	__READ_ONCE_SIZE;
 }
-#endif
 
 static __always_inline void __write_once_size(volatile void *p, void *res, int size)
 {
-- 
2.13.6

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

end of thread, other threads:[~2018-02-01 20:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-01 18:00 [PATCH 1/5] compiler.h, kasan: Avoid duplicating __read_once_size_nocheck() Andrey Ryabinin
2018-02-01 18:00 ` [PATCH 2/5] compiler.h: Add read_word_at_a_time() function Andrey Ryabinin
2018-02-01 18:00 ` [PATCH 3/5] lib/strscpy: Shut up KASAN false-positives in strscpy() Andrey Ryabinin
2018-02-01 18:00 ` [PATCH 4/5] fs/dcache: Use read_word_at_a_time() in dentry_string_cmp() Andrey Ryabinin
2018-02-01 18:00 ` [PATCH 5/5] fs: dcache: Revert "manually unpoison dname after allocation to shut up kasan's reports" Andrey Ryabinin
2018-02-01 18:28 ` [PATCH 1/5] compiler.h, kasan: Avoid duplicating __read_once_size_nocheck() Linus Torvalds
2018-02-01 20:14   ` Andrey Ryabinin
2018-02-01 20:26     ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®