summaryrefslogtreecommitdiff
path: root/kernel/printk
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2024-08-20 08:35:32 +0206
committerPetr Mladek <pmladek@suse.com>2024-08-21 14:56:23 +0200
commitb7049d88c1763d5f133b0e93e39da8e89a9f944b (patch)
treeeedcb12c6ea83d2036ad895653070ad99262c555 /kernel/printk
parent8c9dab2c55ad74680728c72949971b20d70b56ca (diff)
downloadlinux-b7049d88c1763d5f133b0e93e39da8e89a9f944b.tar.gz
linux-b7049d88c1763d5f133b0e93e39da8e89a9f944b.tar.bz2
linux-b7049d88c1763d5f133b0e93e39da8e89a9f944b.zip
printk: nbcon: Remove return value for write_atomic()
The return value of write_atomic() does not provide any useful information. On the contrary, it makes things more complicated for the caller to appropriately deal with the information. Change write_atomic() to not have a return value. If the message did not get printed due to loss of ownership, the caller will notice this on its own. If ownership was not lost, it will be assumed that the driver successfully printed the message and the sequence number for that console will be incremented. Signed-off-by: John Ogness <john.ogness@linutronix.de> Reviewed-by: Petr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/20240820063001.36405-7-john.ogness@linutronix.de Signed-off-by: Petr Mladek <pmladek@suse.com>
Diffstat (limited to 'kernel/printk')
-rw-r--r--kernel/printk/nbcon.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c
index 931b8f086902..f279f839741a 100644
--- a/kernel/printk/nbcon.c
+++ b/kernel/printk/nbcon.c
@@ -885,7 +885,6 @@ static bool nbcon_emit_next_record(struct nbcon_write_context *wctxt)
unsigned long con_dropped;
struct nbcon_state cur;
unsigned long dropped;
- bool done;
/*
* The printk buffers are filled within an unsafe section. This
@@ -925,16 +924,16 @@ static bool nbcon_emit_next_record(struct nbcon_write_context *wctxt)
wctxt->unsafe_takeover = cur.unsafe_takeover;
if (con->write_atomic) {
- done = con->write_atomic(con, wctxt);
+ con->write_atomic(con, wctxt);
} else {
- nbcon_context_release(ctxt);
+ /*
+ * This function should never be called for legacy consoles.
+ * Handle it as if ownership was lost and try to continue.
+ */
WARN_ON_ONCE(1);
- done = false;
- }
-
- /* If not done, the emit was aborted. */
- if (!done)
+ nbcon_context_release(ctxt);
return false;
+ }
/*
* Since any dropped message was successfully output, reset the