Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9f69ba86d66297189916ceae401fe0944a207714
Commit:     9f69ba86d66297189916ceae401fe0944a207714
Parent:     c9f27c3619b3ee26b8ec47692bdd3a7ac075ad87
Author:     Greg Ungerer <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 1 17:38:34 2008 +1000
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Feb 1 21:00:01 2008 +1100

    m68knommu: use container_of in mcf.c
    
    Use container_of() instead of assuming local uart struct is first member
    of uart_port struct.
    
    Signed-off-by: Greg Ungerer <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/serial/mcf.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/serial/mcf.c b/drivers/serial/mcf.c
index a7d4360..051fcc2 100644
--- a/drivers/serial/mcf.c
+++ b/drivers/serial/mcf.c
@@ -69,7 +69,7 @@ static unsigned int mcf_tx_empty(struct uart_port *port)
 
 static unsigned int mcf_get_mctrl(struct uart_port *port)
 {
-       struct mcf_uart *pp = (struct mcf_uart *) port;
+       struct mcf_uart *pp = container_of(port, struct mcf_uart, port);
        unsigned long flags;
        unsigned int sigs;
 
@@ -87,7 +87,7 @@ static unsigned int mcf_get_mctrl(struct uart_port *port)
 
 static void mcf_set_mctrl(struct uart_port *port, unsigned int sigs)
 {
-       struct mcf_uart *pp = (struct mcf_uart *) port;
+       struct mcf_uart *pp = container_of(port, struct mcf_uart, port);
        unsigned long flags;
 
        spin_lock_irqsave(&port->lock, flags);
@@ -104,7 +104,7 @@ static void mcf_set_mctrl(struct uart_port *port, unsigned 
int sigs)
 
 static void mcf_start_tx(struct uart_port *port)
 {
-       struct mcf_uart *pp = (struct mcf_uart *) port;
+       struct mcf_uart *pp = container_of(port, struct mcf_uart, port);
        unsigned long flags;
 
        spin_lock_irqsave(&port->lock, flags);
@@ -117,7 +117,7 @@ static void mcf_start_tx(struct uart_port *port)
 
 static void mcf_stop_tx(struct uart_port *port)
 {
-       struct mcf_uart *pp = (struct mcf_uart *) port;
+       struct mcf_uart *pp = container_of(port, struct mcf_uart, port);
        unsigned long flags;
 
        spin_lock_irqsave(&port->lock, flags);
@@ -130,7 +130,7 @@ static void mcf_stop_tx(struct uart_port *port)
 
 static void mcf_stop_rx(struct uart_port *port)
 {
-       struct mcf_uart *pp = (struct mcf_uart *) port;
+       struct mcf_uart *pp = container_of(port, struct mcf_uart, port);
        unsigned long flags;
 
        spin_lock_irqsave(&port->lock, flags);
@@ -163,7 +163,7 @@ static void mcf_enable_ms(struct uart_port *port)
 
 static int mcf_startup(struct uart_port *port)
 {
-       struct mcf_uart *pp = (struct mcf_uart *) port;
+       struct mcf_uart *pp = container_of(port, struct mcf_uart, port);
        unsigned long flags;
 
        spin_lock_irqsave(&port->lock, flags);
@@ -189,7 +189,7 @@ static int mcf_startup(struct uart_port *port)
 
 static void mcf_shutdown(struct uart_port *port)
 {
-       struct mcf_uart *pp = (struct mcf_uart *) port;
+       struct mcf_uart *pp = container_of(port, struct mcf_uart, port);
        unsigned long flags;
 
        spin_lock_irqsave(&port->lock, flags);
@@ -273,7 +273,7 @@ static void mcf_set_termios(struct uart_port *port, struct 
ktermios *termios,
 
 static void mcf_rx_chars(struct mcf_uart *pp)
 {
-       struct uart_port *port = (struct uart_port *) pp;
+       struct uart_port *port = &pp->port;
        unsigned char status, ch, flag;
 
        while ((status = readb(port->membase + MCFUART_USR)) & 
MCFUART_USR_RXREADY) {
@@ -319,7 +319,7 @@ static void mcf_rx_chars(struct mcf_uart *pp)
 
 static void mcf_tx_chars(struct mcf_uart *pp)
 {
-       struct uart_port *port = (struct uart_port *) pp;
+       struct uart_port *port = &pp->port;
        struct circ_buf *xmit = &port->info->xmit;
 
        if (port->x_char) {
@@ -352,7 +352,7 @@ static void mcf_tx_chars(struct mcf_uart *pp)
 static irqreturn_t mcf_interrupt(int irq, void *data)
 {
        struct uart_port *port = data;
-       struct mcf_uart *pp = (struct mcf_uart *) port;
+       struct mcf_uart *pp = container_of(port, struct mcf_uart, port);
        unsigned int isr;
 
        isr = readb(port->membase + MCFUART_UISR) & pp->imr;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to