[PATCH 7/7] tty: serial_core: Add missing annotation for _unlock_and_check_sysrq()

Subsystems: the rest, tty layer and serial drivers

STALE2376d

2 messages, 2 authors, 2020-04-16 · open the first message on its own page

[PATCH 7/7] tty: serial_core: Add missing annotation for _unlock_and_check_sysrq()

From: Jules Irenge <hidden>
Date: 2020-03-31 20:47:27

Sparse reports a warning at _unlock_and_check_sysrq()

warning: context imbalance in uart_unlock_and_check_sysrq()
	- unexpected unlock

The root cause is the missing annotation at _unlock_and_check_sysrq()
Add the missing __releases(&port->lock) annotation.

Signed-off-by: Jules Irenge <redacted>
---
 drivers/tty/serial/serial_core.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 76e506ee335c..32f93f03efce 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -3121,6 +3121,7 @@ int uart_prepare_sysrq_char(struct uart_port *port, unsigned int ch)
 EXPORT_SYMBOL_GPL(uart_prepare_sysrq_char);
 
 void uart_unlock_and_check_sysrq(struct uart_port *port, unsigned long irqflags)
+	__releases(&port->lock)
 {
 	int sysrq_ch;
 
-- 
2.24.1

Re: [PATCH 7/7] tty: serial_core: Add missing annotation for _unlock_and_check_sysrq()

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2020-04-16 14:32:11

On Tue, Mar 31, 2020 at 09:46:43PM +0100, Jules Irenge wrote:
quoted hunk
Sparse reports a warning at _unlock_and_check_sysrq()

warning: context imbalance in uart_unlock_and_check_sysrq()
	- unexpected unlock

The root cause is the missing annotation at _unlock_and_check_sysrq()
Add the missing __releases(&port->lock) annotation.

Signed-off-by: Jules Irenge <redacted>
---
 drivers/tty/serial/serial_core.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 76e506ee335c..32f93f03efce 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -3121,6 +3121,7 @@ int uart_prepare_sysrq_char(struct uart_port *port, unsigned int ch)
 EXPORT_SYMBOL_GPL(uart_prepare_sysrq_char);
 
 void uart_unlock_and_check_sysrq(struct uart_port *port, unsigned long irqflags)
+	__releases(&port->lock)
 {
 	int sysrq_ch;
 
-- 
2.24.1
This is already in the tree, are you sure you are not working from an
older one?

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help