]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/serial/cpm_uart/cpm_uart.h
Merge master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6
[linux-2.6-omap-h63xx.git] / drivers / serial / cpm_uart / cpm_uart.h
index aa5eb7ddeda9adf3b41a61ecbc716502fb2392c0..69715e55650612ebca86fd7d8b069e6ad4eb03a9 100644 (file)
@@ -5,11 +5,17 @@
  *
  *  Copyright (C) 2004 Freescale Semiconductor, Inc.
  *
+ *  2006 (c) MontaVista Software, Inc.
+ *     Vitaly Bordug <vbordug@ru.mvista.com>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ *
  */
 #ifndef CPM_UART_H
 #define CPM_UART_H
 
-#include <linux/config.h>
 #include <linux/platform_device.h>
 #include <linux/fs_uart_pd.h>
 
@@ -82,7 +88,7 @@ extern struct uart_cpm_port cpm_uart_ports[UART_NR];
 
 /* these are located in their respective files */
 void cpm_line_cr_cmd(int line, int cmd);
-int cpm_uart_init_portdesc(void);
+int __init cpm_uart_init_portdesc(void);
 int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con);
 void cpm_uart_freebuf(struct uart_cpm_port *pinfo);
 
@@ -101,12 +107,13 @@ static inline unsigned long cpu2cpm_addr(void* addr, struct uart_cpm_port *pinfo
        int offset;
        u32 val = (u32)addr;
        /* sane check */
-       if ((val >= (u32)pinfo->mem_addr) &&
+       if (likely((val >= (u32)pinfo->mem_addr)) &&
                        (val<((u32)pinfo->mem_addr + pinfo->mem_size))) {
                offset = val - (u32)pinfo->mem_addr;
                return pinfo->dma_addr+offset;
        }
-       printk("%s(): address %x to translate out of range!\n", __FUNCTION__, val);
+       /* something nasty happened */
+       BUG();
        return 0;
 }
 
@@ -115,12 +122,13 @@ static inline void *cpm2cpu_addr(unsigned long addr, struct uart_cpm_port *pinfo
        int offset;
        u32 val = addr;
        /* sane check */
-       if ((val >= pinfo->dma_addr) &&
-                       (val<(pinfo->dma_addr + pinfo->mem_size))) {
+       if (likely((val >= pinfo->dma_addr) &&
+                       (val<(pinfo->dma_addr + pinfo->mem_size)))) {
                offset = val - (u32)pinfo->dma_addr;
                return (void*)(pinfo->mem_addr+offset);
        }
-       printk("%s(): address %x to translate out of range!\n", __FUNCTION__, val);
+       /* something nasty happened */
+       BUG();
        return 0;
 }