All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drivers/serial/bfin_5xx.c: Fix logging messages continued with \
@ 2010-08-23 19:01 Joe Perches
  2010-08-23 19:01 ` [PATCH 2/2] drivers/serial/bfin_5xx.c: Use pr_<level> and pr_<fmt> Joe Perches
  2010-08-24  2:37 ` [PATCH 1/2] drivers/serial/bfin_5xx.c: Fix logging messages continued with \ Zhang, Sonic
  0 siblings, 2 replies; 6+ messages in thread
From: Joe Perches @ 2010-08-23 19:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sonic Zhang, uclinux-dist-devel

Using continuation lines often introduces undesired whitespace.
Fix the misuses.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/serial/bfin_5xx.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index a9eff2b..4e38f99 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -734,8 +734,8 @@ static int bfin_serial_startup(struct uart_port *port)
 			IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
 			IRQF_DISABLED, "BFIN_UART_CTS", uart)) {
 			uart->cts_pin = -1;
-			pr_info("Unable to attach BlackFin UART CTS interrupt.\
-				 So, disable it.\n");
+			pr_info("Unable to attach BlackFin UART CTS interrupt. "
+				"So, disable it.\n");
 		}
 	}
 	if (uart->rts_pin >= 0) {
@@ -747,8 +747,8 @@ static int bfin_serial_startup(struct uart_port *port)
 	if (request_irq(uart->status_irq,
 		bfin_serial_mctrl_cts_int,
 		IRQF_DISABLED, "BFIN_UART_MODEM_STATUS", uart)) {
-		pr_info("Unable to attach BlackFin UART Modem \
-			Status interrupt.\n");
+		pr_info("Unable to attach BlackFin UART Modem "
+			"Status interrupt.\n");
 	}
 
 	/* CTS RTS PINs are negative assertive. */
-- 
1.7.2.19.g9a302


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] drivers/serial/bfin_5xx.c: Use pr_<level> and pr_<fmt>
  2010-08-23 19:01 [PATCH 1/2] drivers/serial/bfin_5xx.c: Fix logging messages continued with \ Joe Perches
@ 2010-08-23 19:01 ` Joe Perches
  2010-08-24  2:42   ` Zhang, Sonic
  2010-08-24  2:37 ` [PATCH 1/2] drivers/serial/bfin_5xx.c: Fix logging messages continued with \ Zhang, Sonic
  1 sibling, 1 reply; 6+ messages in thread
From: Joe Perches @ 2010-08-23 19:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sonic Zhang, uclinux-dist-devel

Also fix typo of length.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/serial/bfin_5xx.c |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index 4e38f99..4c01ee6 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -8,6 +8,8 @@
  * Licensed under the GPL-2 or later.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
 #endif
@@ -631,12 +633,12 @@ static int bfin_serial_startup(struct uart_port *port)
 	dma_addr_t dma_handle;
 
 	if (request_dma(uart->rx_dma_channel, "BFIN_UART_RX") < 0) {
-		printk(KERN_NOTICE "Unable to attach Blackfin UART RX DMA channel\n");
+		pr_notice("Unable to attach Blackfin UART RX DMA channel\n");
 		return -EBUSY;
 	}
 
 	if (request_dma(uart->tx_dma_channel, "BFIN_UART_TX") < 0) {
-		printk(KERN_NOTICE "Unable to attach Blackfin UART TX DMA channel\n");
+		pr_notice("Unable to attach Blackfin UART TX DMA channel\n");
 		free_dma(uart->rx_dma_channel);
 		return -EBUSY;
 	}
@@ -674,14 +676,14 @@ static int bfin_serial_startup(struct uart_port *port)
 # endif
 	if (request_irq(uart->port.irq, bfin_serial_rx_int, IRQF_DISABLED,
 	     "BFIN_UART_RX", uart)) {
-		printk(KERN_NOTICE "Unable to attach BlackFin UART RX interrupt\n");
+		pr_notice("Unable to attach BlackFin UART RX interrupt\n");
 		return -EBUSY;
 	}
 
 	if (request_irq
 	    (uart->port.irq+1, bfin_serial_tx_int, IRQF_DISABLED,
 	     "BFIN_UART_TX", uart)) {
-		printk(KERN_NOTICE "Unable to attach BlackFin UART TX interrupt\n");
+		pr_notice("Unable to attach BlackFin UART TX interrupt\n");
 		free_irq(uart->port.irq, uart);
 		return -EBUSY;
 	}
@@ -706,14 +708,14 @@ static int bfin_serial_startup(struct uart_port *port)
 
 		if (uart_dma_ch_rx &&
 			request_dma(uart_dma_ch_rx, "BFIN_UART_RX") < 0) {
-			printk(KERN_NOTICE"Fail to attach UART interrupt\n");
+			pr_notice("Fail to attach UART interrupt\n");
 			free_irq(uart->port.irq, uart);
 			free_irq(uart->port.irq + 1, uart);
 			return -EBUSY;
 		}
 		if (uart_dma_ch_tx &&
 			request_dma(uart_dma_ch_tx, "BFIN_UART_TX") < 0) {
-			printk(KERN_NOTICE "Fail to attach UART interrupt\n");
+			pr_notice("Fail to attach UART interrupt\n");
 			free_dma(uart_dma_ch_rx);
 			free_irq(uart->port.irq, uart);
 			free_irq(uart->port.irq + 1, uart);
@@ -734,8 +736,7 @@ static int bfin_serial_startup(struct uart_port *port)
 			IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
 			IRQF_DISABLED, "BFIN_UART_CTS", uart)) {
 			uart->cts_pin = -1;
-			pr_info("Unable to attach BlackFin UART CTS interrupt. "
-				"So, disable it.\n");
+			pr_info("Unable to attach BlackFin UART CTS interrupt. So, disable it.\n");
 		}
 	}
 	if (uart->rts_pin >= 0) {
@@ -747,8 +748,7 @@ static int bfin_serial_startup(struct uart_port *port)
 	if (request_irq(uart->status_irq,
 		bfin_serial_mctrl_cts_int,
 		IRQF_DISABLED, "BFIN_UART_MODEM_STATUS", uart)) {
-		pr_info("Unable to attach BlackFin UART Modem "
-			"Status interrupt.\n");
+		pr_info("Unable to attach BlackFin UART Modem Status interrupt\n");
 	}
 
 	/* CTS RTS PINs are negative assertive. */
@@ -825,8 +825,7 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios,
 		lcr = WLS(5);
 		break;
 	default:
-		printk(KERN_ERR "%s: word lengh not supported\n",
-			__func__);
+		pr_err("%s: word length not supported\n", __func__);
 	}
 
 	/* Anomaly notes:
@@ -834,8 +833,7 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios,
 	 */
 	if (termios->c_cflag & CSTOPB) {
 		if (ANOMALY_05000231)
-			printk(KERN_WARNING "STOP bits other than 1 is not "
-				"supported in case of anomaly 05000231.\n");
+			pr_warning("STOP bits other than 1 is not supported in case of anomaly 05000231\n");
 		else
 			lcr |= STB;
 	}
@@ -1188,7 +1186,8 @@ bfin_serial_console_get_options(struct bfin_serial_port *uart, int *baud,
 
 		*baud = get_sclk() / (16*(dll | dlh << 8));
 	}
-	pr_debug("%s:baud = %d, parity = %c, bits= %d\n", __func__, *baud, *parity, *bits);
+	pr_debug("%s:baud = %d, parity = %c, bits= %d\n",
+		 __func__, *baud, *parity, *bits);
 }
 
 static struct uart_driver bfin_serial_reg;
-- 
1.7.2.19.g9a302


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* RE: [PATCH 1/2] drivers/serial/bfin_5xx.c: Fix logging messages continued with \
  2010-08-23 19:01 [PATCH 1/2] drivers/serial/bfin_5xx.c: Fix logging messages continued with \ Joe Perches
  2010-08-23 19:01 ` [PATCH 2/2] drivers/serial/bfin_5xx.c: Use pr_<level> and pr_<fmt> Joe Perches
@ 2010-08-24  2:37 ` Zhang, Sonic
  1 sibling, 0 replies; 6+ messages in thread
From: Zhang, Sonic @ 2010-08-24  2:37 UTC (permalink / raw)
  To: Joe Perches, linux-kernel; +Cc: uclinux-dist-devel

 

>-----Original Message-----
>From: Joe Perches [mailto:joe@perches.com] 
>Sent: Tuesday, August 24, 2010 3:02 AM
>To: linux-kernel@vger.kernel.org
>Cc: Zhang, Sonic; uclinux-dist-devel@blackfin.uclinux.org
>Subject: [PATCH 1/2] drivers/serial/bfin_5xx.c: Fix logging 
>messages continued with \
>
>Using continuation lines often introduces undesired whitespace.
>Fix the misuses.
>

Acked-by: Sonic Zhang <sonic.zhang@analog.com>


>Signed-off-by: Joe Perches <joe@perches.com>
>---
> drivers/serial/bfin_5xx.c |    8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/serial/bfin_5xx.c 
>b/drivers/serial/bfin_5xx.c index a9eff2b..4e38f99 100644
>--- a/drivers/serial/bfin_5xx.c
>+++ b/drivers/serial/bfin_5xx.c
>@@ -734,8 +734,8 @@ static int bfin_serial_startup(struct 
>uart_port *port)
> 			IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
> 			IRQF_DISABLED, "BFIN_UART_CTS", uart)) {
> 			uart->cts_pin = -1;
>-			pr_info("Unable to attach BlackFin UART 
>CTS interrupt.\
>-				 So, disable it.\n");
>+			pr_info("Unable to attach BlackFin UART 
>CTS interrupt. "
>+				"So, disable it.\n");
> 		}
> 	}
> 	if (uart->rts_pin >= 0) {
>@@ -747,8 +747,8 @@ static int bfin_serial_startup(struct 
>uart_port *port)
> 	if (request_irq(uart->status_irq,
> 		bfin_serial_mctrl_cts_int,
> 		IRQF_DISABLED, "BFIN_UART_MODEM_STATUS", uart)) {
>-		pr_info("Unable to attach BlackFin UART Modem \
>-			Status interrupt.\n");
>+		pr_info("Unable to attach BlackFin UART Modem "
>+			"Status interrupt.\n");
> 	}
> 
> 	/* CTS RTS PINs are negative assertive. */
>--
>1.7.2.19.g9a302
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH 2/2] drivers/serial/bfin_5xx.c: Use pr_<level> and pr_<fmt>
  2010-08-23 19:01 ` [PATCH 2/2] drivers/serial/bfin_5xx.c: Use pr_<level> and pr_<fmt> Joe Perches
@ 2010-08-24  2:42   ` Zhang, Sonic
  2010-08-24  3:30     ` Joe Perches
  0 siblings, 1 reply; 6+ messages in thread
From: Zhang, Sonic @ 2010-08-24  2:42 UTC (permalink / raw)
  To: Joe Perches, linux-kernel; +Cc: uclinux-dist-devel

 

>-----Original Message-----
>From: Joe Perches [mailto:joe@perches.com] 
>Sent: Tuesday, August 24, 2010 3:02 AM
>To: linux-kernel@vger.kernel.org
>Cc: Zhang, Sonic; uclinux-dist-devel@blackfin.uclinux.org
>Subject: [PATCH 2/2] drivers/serial/bfin_5xx.c: Use pr_<level> 
>and pr_<fmt>
>
>Also fix typo of length.
>
>Signed-off-by: Joe Perches <joe@perches.com>
>---
> drivers/serial/bfin_5xx.c |   29 ++++++++++++++---------------
> 1 files changed, 14 insertions(+), 15 deletions(-)
>
>diff --git a/drivers/serial/bfin_5xx.c 
>b/drivers/serial/bfin_5xx.c index 4e38f99..4c01ee6 100644
>--- a/drivers/serial/bfin_5xx.c
>+++ b/drivers/serial/bfin_5xx.c
>@@ -8,6 +8,8 @@
>  * Licensed under the GPL-2 or later.
>  */
> 
>+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>+
> #if defined(CONFIG_SERIAL_BFIN_CONSOLE) && 
>defined(CONFIG_MAGIC_SYSRQ)  #define SUPPORT_SYSRQ  #endif @@ 
>-631,12 +633,12 @@ static int bfin_serial_startup(struct 
>uart_port *port)
> 	dma_addr_t dma_handle;
> 
> 	if (request_dma(uart->rx_dma_channel, "BFIN_UART_RX") < 0) {
>-		printk(KERN_NOTICE "Unable to attach Blackfin 
>UART RX DMA channel\n");
>+		pr_notice("Unable to attach Blackfin UART RX 
>DMA channel\n");
> 		return -EBUSY;
> 	}
> 
> 	if (request_dma(uart->tx_dma_channel, "BFIN_UART_TX") < 0) {
>-		printk(KERN_NOTICE "Unable to attach Blackfin 
>UART TX DMA channel\n");
>+		pr_notice("Unable to attach Blackfin UART TX 
>DMA channel\n");
> 		free_dma(uart->rx_dma_channel);
> 		return -EBUSY;
> 	}
>@@ -674,14 +676,14 @@ static int bfin_serial_startup(struct 
>uart_port *port)  # endif
> 	if (request_irq(uart->port.irq, bfin_serial_rx_int, 
>IRQF_DISABLED,
> 	     "BFIN_UART_RX", uart)) {
>-		printk(KERN_NOTICE "Unable to attach BlackFin 
>UART RX interrupt\n");
>+		pr_notice("Unable to attach BlackFin UART RX 
>interrupt\n");
> 		return -EBUSY;
> 	}
> 
> 	if (request_irq
> 	    (uart->port.irq+1, bfin_serial_tx_int, IRQF_DISABLED,
> 	     "BFIN_UART_TX", uart)) {
>-		printk(KERN_NOTICE "Unable to attach BlackFin 
>UART TX interrupt\n");
>+		pr_notice("Unable to attach BlackFin UART TX 
>interrupt\n");
> 		free_irq(uart->port.irq, uart);
> 		return -EBUSY;
> 	}
>@@ -706,14 +708,14 @@ static int bfin_serial_startup(struct 
>uart_port *port)
> 
> 		if (uart_dma_ch_rx &&
> 			request_dma(uart_dma_ch_rx, 
>"BFIN_UART_RX") < 0) {
>-			printk(KERN_NOTICE"Fail to attach UART 
>interrupt\n");
>+			pr_notice("Fail to attach UART interrupt\n");
> 			free_irq(uart->port.irq, uart);
> 			free_irq(uart->port.irq + 1, uart);
> 			return -EBUSY;
> 		}
> 		if (uart_dma_ch_tx &&
> 			request_dma(uart_dma_ch_tx, 
>"BFIN_UART_TX") < 0) {
>-			printk(KERN_NOTICE "Fail to attach UART 
>interrupt\n");
>+			pr_notice("Fail to attach UART interrupt\n");
> 			free_dma(uart_dma_ch_rx);
> 			free_irq(uart->port.irq, uart);
> 			free_irq(uart->port.irq + 1, uart);
>@@ -734,8 +736,7 @@ static int bfin_serial_startup(struct 
>uart_port *port)
> 			IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
> 			IRQF_DISABLED, "BFIN_UART_CTS", uart)) {
> 			uart->cts_pin = -1;
>-			pr_info("Unable to attach BlackFin UART 
>CTS interrupt. "
>-				"So, disable it.\n");
>+			pr_info("Unable to attach BlackFin UART 
>CTS interrupt. So, disable 
>+it.\n");
> 		}
> 	}
> 	if (uart->rts_pin >= 0) {
>@@ -747,8 +748,7 @@ static int bfin_serial_startup(struct 
>uart_port *port)
> 	if (request_irq(uart->status_irq,
> 		bfin_serial_mctrl_cts_int,
> 		IRQF_DISABLED, "BFIN_UART_MODEM_STATUS", uart)) {
>-		pr_info("Unable to attach BlackFin UART Modem "
>-			"Status interrupt.\n");
>+		pr_info("Unable to attach BlackFin UART Modem 
>Status interrupt\n");

I don't this this change is necessary.

> 	}
> 
> 	/* CTS RTS PINs are negative assertive. */ @@ -825,8 
>+825,7 @@ bfin_serial_set_termios(struct uart_port *port, 
>struct ktermios *termios,
> 		lcr = WLS(5);
> 		break;
> 	default:
>-		printk(KERN_ERR "%s: word lengh not supported\n",
>-			__func__);
>+		pr_err("%s: word length not supported\n", __func__);
> 	}
> 
> 	/* Anomaly notes:
>@@ -834,8 +833,7 @@ bfin_serial_set_termios(struct uart_port 
>*port, struct ktermios *termios,
> 	 */
> 	if (termios->c_cflag & CSTOPB) {
> 		if (ANOMALY_05000231)
>-			printk(KERN_WARNING "STOP bits other 
>than 1 is not "
>-				"supported in case of anomaly 
>05000231.\n");
>+			pr_warning("STOP bits other than 1 is 
>not supported in case of 
>+anomaly 05000231\n");

How about following style?

			pr_warning( "STOP bits other than 1 is not "
				"supported in case of anomaly
05000231.\n");


Sonic Zhang

> 		else
> 			lcr |= STB;
> 	}
>@@ -1188,7 +1186,8 @@ bfin_serial_console_get_options(struct 
>bfin_serial_port *uart, int *baud,
> 
> 		*baud = get_sclk() / (16*(dll | dlh << 8));
> 	}
>-	pr_debug("%s:baud = %d, parity = %c, bits= %d\n", 
>__func__, *baud, *parity, *bits);
>+	pr_debug("%s:baud = %d, parity = %c, bits= %d\n",
>+		 __func__, *baud, *parity, *bits);
> }
> 
> static struct uart_driver bfin_serial_reg;
>--
>1.7.2.19.g9a302
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH 2/2] drivers/serial/bfin_5xx.c: Use pr_<level> and pr_<fmt>
  2010-08-24  2:42   ` Zhang, Sonic
@ 2010-08-24  3:30     ` Joe Perches
  2010-08-24  3:47       ` Mike Frysinger
  0 siblings, 1 reply; 6+ messages in thread
From: Joe Perches @ 2010-08-24  3:30 UTC (permalink / raw)
  To: Zhang, Sonic; +Cc: linux-kernel, uclinux-dist-devel

On Tue, 24 Aug 2010, Zhang, Sonic wrote:
> >Also fix typo of length.
> >Signed-off-by: Joe Perches <joe@perches.com>
> >-		pr_info("Unable to attach BlackFin UART Modem "
> >-			"Status interrupt.\n");
> >+		pr_info("Unable to attach BlackFin UART Modem
> >Status interrupt\n");
> I don't this this change is necessary.

Linus once said he doesn't like splitting
format lines because it makes grep more
difficult.

http://lkml.org/lkml/2009/12/17/229

> How about following style?
>
> 			pr_warning( "STOP bits other than 1 is not "
> 				"supported in case of anomaly
> 05000231.\n");

Fix it up as you prefer.

cheers, Joe


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] drivers/serial/bfin_5xx.c: Use pr_<level> and pr_<fmt>
  2010-08-24  3:30     ` Joe Perches
@ 2010-08-24  3:47       ` Mike Frysinger
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2010-08-24  3:47 UTC (permalink / raw)
  To: Joe Perches; +Cc: Zhang, Sonic, linux-kernel, uclinux-dist-devel

On Mon, Aug 23, 2010 at 23:30, Joe Perches wrote:
> On Tue, 24 Aug 2010, Zhang, Sonic wrote:
>> >Also fix typo of length.
>> >Signed-off-by: Joe Perches <joe@perches.com>
>> >-            pr_info("Unable to attach BlackFin UART Modem "
>> >-                    "Status interrupt.\n");
>> >+            pr_info("Unable to attach BlackFin UART Modem
>> >Status interrupt\n");
>> I don't this this change is necessary.
>
> Linus once said he doesn't like splitting
> format lines because it makes grep more
> difficult.
>
> http://lkml.org/lkml/2009/12/17/229

ah, i hadnt realized sanity had come to town.  this was one of my
largest gripes about string splitting ... having to figure out the
magic variation in substrings for grep to find a match.
-mike

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-08-24  3:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-23 19:01 [PATCH 1/2] drivers/serial/bfin_5xx.c: Fix logging messages continued with \ Joe Perches
2010-08-23 19:01 ` [PATCH 2/2] drivers/serial/bfin_5xx.c: Use pr_<level> and pr_<fmt> Joe Perches
2010-08-24  2:42   ` Zhang, Sonic
2010-08-24  3:30     ` Joe Perches
2010-08-24  3:47       ` Mike Frysinger
2010-08-24  2:37 ` [PATCH 1/2] drivers/serial/bfin_5xx.c: Fix logging messages continued with \ Zhang, Sonic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.