In preparation for cleaning up "cut here", move the "cut here" logic
up out of __warn() and into callers that pass non-NULL args. For anyone
looking closely, there are two callers that pass NULL args: one already
explicitly prints "cut here". The remaining case is covered by how a
WARN is built, which will be cleaned up in the next patch.

Signed-off-by: Kees Cook <[email protected]>
---
 kernel/panic.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index 51efdeb2558e..dc2243429903 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -551,9 +551,6 @@ void __warn(const char *file, int line, void *caller, 
unsigned taint,
 {
        disable_trace_on_warning();
 
-       if (args)
-               pr_warn(CUT_HERE);
-
        if (file)
                pr_warn("WARNING: CPU: %d PID: %d at %s:%d %pS\n",
                        raw_smp_processor_id(), current->pid, file, line,
@@ -597,8 +594,9 @@ void warn_slowpath_fmt(const char *file, int line, unsigned 
taint,
 {
        struct warn_args args;
 
+       pr_warn(CUT_HERE);
+
        if (!fmt) {
-               pr_warn(CUT_HERE);
                __warn(file, line, __builtin_return_address(0), taint,
                       NULL, NULL);
                return;
-- 
2.17.1

Reply via email to