From: Andrey Konovalov Date: Fri, 25 Mar 2022 01:12:34 +0000 (-0700) Subject: kasan: check CONFIG_KASAN_KUNIT_TEST instead of CONFIG_KUNIT X-Git-Tag: v6.6.17~7915^2~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49d9977ac909a98a9bbd689a64b1d872ac10215b;p=platform%2Fkernel%2Flinux-rpi.git kasan: check CONFIG_KASAN_KUNIT_TEST instead of CONFIG_KUNIT Check the more specific CONFIG_KASAN_KUNIT_TEST config option when defining things related to KUnit-compatible KASAN tests instead of CONFIG_KUNIT. Also put the kunit_kasan_status definition next to the definitons of other KASAN-related structs. Link: https://lkml.kernel.org/r/223592d38d2a601a160a3b2b3d5a9f9090350e62.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index 4447df0..cc7162a 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -7,16 +7,6 @@ #include #include -#if IS_ENABLED(CONFIG_KUNIT) - -/* Used in KUnit-compatible KASAN tests. */ -struct kunit_kasan_status { - bool report_found; - bool sync_fault; -}; - -#endif - #ifdef CONFIG_KASAN_HW_TAGS #include @@ -224,6 +214,14 @@ struct kasan_free_meta { #endif }; +#if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST) +/* Used in KUnit-compatible KASAN tests. */ +struct kunit_kasan_status { + bool report_found; + bool sync_fault; +}; +#endif + struct kasan_alloc_meta *kasan_get_alloc_meta(struct kmem_cache *cache, const void *object); #ifdef CONFIG_KASAN_GENERIC diff --git a/mm/kasan/report.c b/mm/kasan/report.c index 59db812..9354315 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -356,7 +356,7 @@ static bool report_enabled(void) return !test_and_set_bit(KASAN_BIT_REPORTED, &kasan_flags); } -#if IS_ENABLED(CONFIG_KUNIT) +#if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST) static void update_kunit_status(bool sync) { struct kunit *test;