aboutsummaryrefslogtreecommitdiff
path: root/drivers/serial/cpm_uart/cpm_uart.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-05-04 15:09:52 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-05-04 15:09:52 -0700
commitd98550e334715b2d9e45f8f0f4e1608720108640 (patch)
treecd6a52960d479701cf6a29fd6535627481c5b27d /drivers/serial/cpm_uart/cpm_uart.h
parentf9cc8475e7595dbb41a9567f83288e2cd7445b6c (diff)
parentd205819e2346d20fee41297ea6cf789c591abccf (diff)
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: [PATCH] powerpc: Use the ibm,pa-features property if available powerpc: Fix incorrect might_sleep in __get_user/__put_user on kernel addresses [PATCH] ppc32 CPM_UART: fixes and improvements [PATCH] ppc32 CPM_UART: Fixed break send on SCC [PATCH] powerpc/kprobes: fix singlestep out-of-line [PATCH] powerpc/pseries: avoid crash in PCI code if mem system not up
Diffstat (limited to 'drivers/serial/cpm_uart/cpm_uart.h')
-rw-r--r--drivers/serial/cpm_uart/cpm_uart.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/serial/cpm_uart/cpm_uart.h b/drivers/serial/cpm_uart/cpm_uart.h
index aa5eb7ddeda..3b35cb77953 100644
--- a/drivers/serial/cpm_uart/cpm_uart.h
+++ b/drivers/serial/cpm_uart/cpm_uart.h
@@ -5,6 +5,13 @@
*
* 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
@@ -101,12 +108,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 +123,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;
}