diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2007-07-31 03:39:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-31 18:39:43 -0400 |
commit | 86d0004abc87025bae1cca43c94e99a27b7bbbd6 (patch) | |
tree | 3743c9cb122f6e7c51077597cc7448a6b1e9f41e /drivers | |
parent | dd22a68228cf1c8dad39d6f9da925bd534aea91d (diff) |
sb1250-duart: __maybe_unused, etc. fixes
This is a set of small fixes addressing points raised with the original
driver submission. In particular, __maybe_unused is used rather than a
local hack and sbd_ops is made const. Additionally I have made two local
string variables automatic as rodata space was wasted for pointers
unnecessarily.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/sb1250-duart.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/serial/sb1250-duart.c b/drivers/serial/sb1250-duart.c index 1d9d7285172a..201253755011 100644 --- a/drivers/serial/sb1250-duart.c +++ b/drivers/serial/sb1250-duart.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #define SUPPORT_SYSRQ | 25 | #define SUPPORT_SYSRQ |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | #include <linux/compiler.h> | ||
28 | #include <linux/console.h> | 29 | #include <linux/console.h> |
29 | #include <linux/delay.h> | 30 | #include <linux/delay.h> |
30 | #include <linux/errno.h> | 31 | #include <linux/errno.h> |
@@ -103,8 +104,6 @@ struct sbd_duart { | |||
103 | 104 | ||
104 | static struct sbd_duart sbd_duarts[DUART_MAX_CHIP]; | 105 | static struct sbd_duart sbd_duarts[DUART_MAX_CHIP]; |
105 | 106 | ||
106 | #define __unused __attribute__((__unused__)) | ||
107 | |||
108 | 107 | ||
109 | /* | 108 | /* |
110 | * Reading and writing SB1250 DUART registers. | 109 | * Reading and writing SB1250 DUART registers. |
@@ -204,12 +203,12 @@ static int sbd_receive_drain(struct sbd_port *sport) | |||
204 | return loops; | 203 | return loops; |
205 | } | 204 | } |
206 | 205 | ||
207 | static int __unused sbd_transmit_ready(struct sbd_port *sport) | 206 | static int __maybe_unused sbd_transmit_ready(struct sbd_port *sport) |
208 | { | 207 | { |
209 | return read_sbdchn(sport, R_DUART_STATUS) & M_DUART_TX_RDY; | 208 | return read_sbdchn(sport, R_DUART_STATUS) & M_DUART_TX_RDY; |
210 | } | 209 | } |
211 | 210 | ||
212 | static int __unused sbd_transmit_drain(struct sbd_port *sport) | 211 | static int __maybe_unused sbd_transmit_drain(struct sbd_port *sport) |
213 | { | 212 | { |
214 | int loops = 10000; | 213 | int loops = 10000; |
215 | 214 | ||
@@ -664,7 +663,7 @@ static void sbd_release_port(struct uart_port *uport) | |||
664 | 663 | ||
665 | static int sbd_map_port(struct uart_port *uport) | 664 | static int sbd_map_port(struct uart_port *uport) |
666 | { | 665 | { |
667 | static const char *err = KERN_ERR "sbd: Cannot map MMIO\n"; | 666 | const char *err = KERN_ERR "sbd: Cannot map MMIO\n"; |
668 | struct sbd_port *sport = to_sport(uport); | 667 | struct sbd_port *sport = to_sport(uport); |
669 | struct sbd_duart *duart = sport->duart; | 668 | struct sbd_duart *duart = sport->duart; |
670 | 669 | ||
@@ -691,8 +690,7 @@ static int sbd_map_port(struct uart_port *uport) | |||
691 | 690 | ||
692 | static int sbd_request_port(struct uart_port *uport) | 691 | static int sbd_request_port(struct uart_port *uport) |
693 | { | 692 | { |
694 | static const char *err = KERN_ERR | 693 | const char *err = KERN_ERR "sbd: Unable to reserve MMIO resource\n"; |
695 | "sbd: Unable to reserve MMIO resource\n"; | ||
696 | struct sbd_duart *duart = to_sport(uport)->duart; | 694 | struct sbd_duart *duart = to_sport(uport)->duart; |
697 | int map_guard; | 695 | int map_guard; |
698 | int ret = 0; | 696 | int ret = 0; |
@@ -755,7 +753,7 @@ static int sbd_verify_port(struct uart_port *uport, struct serial_struct *ser) | |||
755 | } | 753 | } |
756 | 754 | ||
757 | 755 | ||
758 | static struct uart_ops sbd_ops = { | 756 | static const struct uart_ops sbd_ops = { |
759 | .tx_empty = sbd_tx_empty, | 757 | .tx_empty = sbd_tx_empty, |
760 | .set_mctrl = sbd_set_mctrl, | 758 | .set_mctrl = sbd_set_mctrl, |
761 | .get_mctrl = sbd_get_mctrl, | 759 | .get_mctrl = sbd_get_mctrl, |