Skip to contentSkip to conversation

drivers: tty: serial: xilinx_uartps: check related config macro before processing 'sysrq'

PATCH Chen Gang 2 participants 3 messages Jan 17, 2014 – Jan 18, 2014

Subsystems (2)
lore
Share & tools
lore

Chen Gang

author
#0 lore raw

Hello Maintainers:

Please help check this patch, when you have time, thanks.

And now I find it is already fixed, but I still feel it can be
improved: "add defined(CONFIG_SERIAL_CORE_CONSOLE)".

Thanks.

-------- Original Message --------
Subject: [PATCH] drivers: tty: serial: xilinx_uartps: check related config macro before processing 'sysrq'
Date: Tue, 10 Dec 2013 13:21:49 +0800
From: Chen Gang <[email protected]>
To: Jiri Slaby <[email protected]>
CC: Greg KH <[email protected]>, James Hogan <[email protected]>, [email protected]

Need check CONFIG_SERIAL_CORE_CONSOLE or SUPPORT_SYSRQ just like the structure definiation has done. Or may cause compiling issue.

The related error (with allmodconfig for metag):

CC [M] drivers/tty/serial/xilinx_uartps.o
drivers/tty/serial/xilinx_uartps.c: In function 'xuartps_isr':
drivers/tty/serial/xilinx_uartps.c:247: error: 'struct uart_port' has no member named 'sysrq'

---
 drivers/tty/serial/xilinx_uartps.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/tty/serial/xilinx_uartps.c +2 -1
index e46e9f3..1501e6b 100644
@@ -244,6 +244,7 @@ static irqreturn_t xuartps_isr(int irq, void *dev_id)
 			 * uart_handle_sysrq_char() doesn't work if
 			 * spinlocked, for some reason
 			 */
+#if defined(CONFIG_SERIAL_CORE_CONSOLE) || defined(SUPPORT_SYSRQ)
 			 if (port->sysrq) {
 				spin_unlock(&port->lock);
 				if (uart_handle_sysrq_char(port,
@@ -253,7 +254,7 @@ static irqreturn_t xuartps_isr(int irq, void *dev_id)
 				}
 				spin_lock(&port->lock);
 			}
-
+#endif
 			port->icount.rx++;
 
 			if (isrstatus & XUARTPS_IXR_PARITY) {
Signature · 9 lines
1.7.7.6



Thanks.
-- 
Chen Gang

Open, share and attitude like air, water and life which God blessed
maintainer
#1 lore raw
Quoted 6 lines · Chen Gang

Hello Maintainers:

Please help check this patch, when you have time, thanks.

And now I find it is already fixed, but I still feel it can be
improved: "add defined(CONFIG_SERIAL_CORE_CONSOLE)".

What do you mean by this?

What can I do with this patch, it's not in a format I can apply it in, and you say it's not needed anymore, so I guess I'll just delete it :(

greg k-h

author
#2 lore raw
Quoted 10 lines · Greg KH
Quoted 6 lines · Chen Gang

Hello Maintainers:

Please help check this patch, when you have time, thanks.

And now I find it is already fixed, but I still feel it can be
improved: "add defined(CONFIG_SERIAL_CORE_CONSOLE)".

What do you mean by this?

Excuse me, I did not say quite clear enough originally.

What I mean is:

------------------------patch begin---------------------------------

drivers: tty: serial: xilinx_uartps: add CONFIG_SERIAL_CORE_CONSOLE switch macro

For structure member 'sysrq', the related header defines it when "#if
defined(CONFIG_SERIAL_CORE_CONSOLE) || defined(SUPPORT_SYSRQ)", so need add CONFIG_SERIAL_CORE_CONSOLE for consistency.

The related patch is

"c2db11e tty: xuartps: Properly guard sysrq specific code"

---
 drivers/tty/serial/xilinx_uartps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/xilinx_uartps.c +1 -1
index f619ad5..17de380 100644
@@ -240,7 +240,7 @@ static irqreturn_t xuartps_isr(int irq, void *dev_id)
 					continue;
 			}
 
-#ifdef SUPPORT_SYSRQ
+#if defined(CONFIG_SERIAL_CORE_CONSOLE) || defined(SUPPORT_SYSRQ)
 			/*
 			 * uart_handle_sysrq_char() doesn't work if
 			 * spinlocked, for some reason
Signature · 3 lines
1.7.11.7

------------------------patch end-------------------------------------
Quoted 5 lines

What can I do with this patch, it's not in a format I can apply it in, and you say it's not needed anymore, so I guess I'll just delete it :(

greg k-h

Thanks.

Signature · 3 lines
Chen Gang

Open, share and attitude like air, water and life which God blessed