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>
This commit is contained in:
committed by
Linus Torvalds
parent
dd22a68228
commit
86d0004abc
@@ -25,6 +25,7 @@
|
|||||||
#define SUPPORT_SYSRQ
|
#define SUPPORT_SYSRQ
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <linux/compiler.h>
|
||||||
#include <linux/console.h>
|
#include <linux/console.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
@@ -103,8 +104,6 @@ struct sbd_duart {
|
|||||||
|
|
||||||
static struct sbd_duart sbd_duarts[DUART_MAX_CHIP];
|
static struct sbd_duart sbd_duarts[DUART_MAX_CHIP];
|
||||||
|
|
||||||
#define __unused __attribute__((__unused__))
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reading and writing SB1250 DUART registers.
|
* Reading and writing SB1250 DUART registers.
|
||||||
@@ -204,12 +203,12 @@ static int sbd_receive_drain(struct sbd_port *sport)
|
|||||||
return loops;
|
return loops;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __unused sbd_transmit_ready(struct sbd_port *sport)
|
static int __maybe_unused sbd_transmit_ready(struct sbd_port *sport)
|
||||||
{
|
{
|
||||||
return read_sbdchn(sport, R_DUART_STATUS) & M_DUART_TX_RDY;
|
return read_sbdchn(sport, R_DUART_STATUS) & M_DUART_TX_RDY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __unused sbd_transmit_drain(struct sbd_port *sport)
|
static int __maybe_unused sbd_transmit_drain(struct sbd_port *sport)
|
||||||
{
|
{
|
||||||
int loops = 10000;
|
int loops = 10000;
|
||||||
|
|
||||||
@@ -664,7 +663,7 @@ static void sbd_release_port(struct uart_port *uport)
|
|||||||
|
|
||||||
static int sbd_map_port(struct uart_port *uport)
|
static int sbd_map_port(struct uart_port *uport)
|
||||||
{
|
{
|
||||||
static const char *err = KERN_ERR "sbd: Cannot map MMIO\n";
|
const char *err = KERN_ERR "sbd: Cannot map MMIO\n";
|
||||||
struct sbd_port *sport = to_sport(uport);
|
struct sbd_port *sport = to_sport(uport);
|
||||||
struct sbd_duart *duart = sport->duart;
|
struct sbd_duart *duart = sport->duart;
|
||||||
|
|
||||||
@@ -691,8 +690,7 @@ static int sbd_map_port(struct uart_port *uport)
|
|||||||
|
|
||||||
static int sbd_request_port(struct uart_port *uport)
|
static int sbd_request_port(struct uart_port *uport)
|
||||||
{
|
{
|
||||||
static const char *err = KERN_ERR
|
const char *err = KERN_ERR "sbd: Unable to reserve MMIO resource\n";
|
||||||
"sbd: Unable to reserve MMIO resource\n";
|
|
||||||
struct sbd_duart *duart = to_sport(uport)->duart;
|
struct sbd_duart *duart = to_sport(uport)->duart;
|
||||||
int map_guard;
|
int map_guard;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@@ -755,7 +753,7 @@ static int sbd_verify_port(struct uart_port *uport, struct serial_struct *ser)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static struct uart_ops sbd_ops = {
|
static const struct uart_ops sbd_ops = {
|
||||||
.tx_empty = sbd_tx_empty,
|
.tx_empty = sbd_tx_empty,
|
||||||
.set_mctrl = sbd_set_mctrl,
|
.set_mctrl = sbd_set_mctrl,
|
||||||
.get_mctrl = sbd_get_mctrl,
|
.get_mctrl = sbd_get_mctrl,
|
||||||
|
Reference in New Issue
Block a user