OSDN Git Service

kasan: simplify kasan_update_kunit_status() and call sites
authorAndrey Konovalov <andreyknvl@google.com>
Fri, 25 Mar 2022 01:12:31 +0000 (18:12 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 25 Mar 2022 02:06:49 +0000 (19:06 -0700)
commit3784c299eafc6dd1ca5a23f4020f18ca565e07af
treeb73ad0674fbf7d2e19214b31f1bdfe493a31415b
parent476b1dc2bc34febc620b8a6cd459f0b3d9950c34
kasan: simplify kasan_update_kunit_status() and call sites

 - Rename kasan_update_kunit_status() to update_kunit_status() (the
   function is static).

 - Move the IS_ENABLED(CONFIG_KUNIT) to the function's definition
   instead of duplicating it at call sites.

 - Obtain and check current->kunit_test within the function.

Link: https://lkml.kernel.org/r/dac26d811ae31856c3d7666de0b108a3735d962d.1646237226.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Marco Elver <elver@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/kasan/report.c