diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-05-04 18:09:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-05-04 18:09:52 -0400 |
commit | d98550e334715b2d9e45f8f0f4e1608720108640 (patch) | |
tree | cd6a52960d479701cf6a29fd6535627481c5b27d /drivers/serial/cpm_uart/cpm_uart.h | |
parent | f9cc8475e7595dbb41a9567f83288e2cd7445b6c (diff) | |
parent | d205819e2346d20fee41297ea6cf789c591abccf (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.h | 19 |
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 aa5eb7ddeda9..3b35cb779539 100644 --- a/drivers/serial/cpm_uart/cpm_uart.h +++ b/drivers/serial/cpm_uart/cpm_uart.h | |||
@@ -5,6 +5,13 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 2004 Freescale Semiconductor, Inc. | 6 | * Copyright (C) 2004 Freescale Semiconductor, Inc. |
7 | * | 7 | * |
8 | * 2006 (c) MontaVista Software, Inc. | ||
9 | * Vitaly Bordug <vbordug@ru.mvista.com> | ||
10 | * | ||
11 | * This file is licensed under the terms of the GNU General Public License | ||
12 | * version 2. This program is licensed "as is" without any warranty of any | ||
13 | * kind, whether express or implied. | ||
14 | * | ||
8 | */ | 15 | */ |
9 | #ifndef CPM_UART_H | 16 | #ifndef CPM_UART_H |
10 | #define CPM_UART_H | 17 | #define CPM_UART_H |
@@ -101,12 +108,13 @@ static inline unsigned long cpu2cpm_addr(void* addr, struct uart_cpm_port *pinfo | |||
101 | int offset; | 108 | int offset; |
102 | u32 val = (u32)addr; | 109 | u32 val = (u32)addr; |
103 | /* sane check */ | 110 | /* sane check */ |
104 | if ((val >= (u32)pinfo->mem_addr) && | 111 | if (likely((val >= (u32)pinfo->mem_addr)) && |
105 | (val<((u32)pinfo->mem_addr + pinfo->mem_size))) { | 112 | (val<((u32)pinfo->mem_addr + pinfo->mem_size))) { |
106 | offset = val - (u32)pinfo->mem_addr; | 113 | offset = val - (u32)pinfo->mem_addr; |
107 | return pinfo->dma_addr+offset; | 114 | return pinfo->dma_addr+offset; |
108 | } | 115 | } |
109 | printk("%s(): address %x to translate out of range!\n", __FUNCTION__, val); | 116 | /* something nasty happened */ |
117 | BUG(); | ||
110 | return 0; | 118 | return 0; |
111 | } | 119 | } |
112 | 120 | ||
@@ -115,12 +123,13 @@ static inline void *cpm2cpu_addr(unsigned long addr, struct uart_cpm_port *pinfo | |||
115 | int offset; | 123 | int offset; |
116 | u32 val = addr; | 124 | u32 val = addr; |
117 | /* sane check */ | 125 | /* sane check */ |
118 | if ((val >= pinfo->dma_addr) && | 126 | if (likely((val >= pinfo->dma_addr) && |
119 | (val<(pinfo->dma_addr + pinfo->mem_size))) { | 127 | (val<(pinfo->dma_addr + pinfo->mem_size)))) { |
120 | offset = val - (u32)pinfo->dma_addr; | 128 | offset = val - (u32)pinfo->dma_addr; |
121 | return (void*)(pinfo->mem_addr+offset); | 129 | return (void*)(pinfo->mem_addr+offset); |
122 | } | 130 | } |
123 | printk("%s(): address %x to translate out of range!\n", __FUNCTION__, val); | 131 | /* something nasty happened */ |
132 | BUG(); | ||
124 | return 0; | 133 | return 0; |
125 | } | 134 | } |
126 | 135 | ||