aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2014-10-21 15:29:09 -0400
committerHelge Deller <deller@gmx.de>2014-11-10 16:22:42 -0500
commit8dd95c68f32b821ec02e89c42a4e500d6aebbd84 (patch)
treebabdd157d28773647c013c7a7da0dd8147dde141 /arch/parisc
parente6be7bb8a32a99495f0d8fa51cac392a6f4bd631 (diff)
parisc: Use BUILD_BUG() instead of undefined functions
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/include/asm/uaccess.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h
index 4006964d8e12..a5cb070b54bf 100644
--- a/arch/parisc/include/asm/uaccess.h
+++ b/arch/parisc/include/asm/uaccess.h
@@ -9,6 +9,8 @@
9#include <asm/errno.h> 9#include <asm/errno.h>
10#include <asm-generic/uaccess-unaligned.h> 10#include <asm-generic/uaccess-unaligned.h>
11 11
12#include <linux/bug.h>
13
12#define VERIFY_READ 0 14#define VERIFY_READ 0
13#define VERIFY_WRITE 1 15#define VERIFY_WRITE 1
14 16
@@ -28,11 +30,6 @@
28 * that put_user is the same as __put_user, etc. 30 * that put_user is the same as __put_user, etc.
29 */ 31 */
30 32
31extern int __get_kernel_bad(void);
32extern int __get_user_bad(void);
33extern int __put_kernel_bad(void);
34extern int __put_user_bad(void);
35
36static inline long access_ok(int type, const void __user * addr, 33static inline long access_ok(int type, const void __user * addr,
37 unsigned long size) 34 unsigned long size)
38{ 35{
@@ -43,8 +40,8 @@ static inline long access_ok(int type, const void __user * addr,
43#define get_user __get_user 40#define get_user __get_user
44 41
45#if !defined(CONFIG_64BIT) 42#if !defined(CONFIG_64BIT)
46#define LDD_KERNEL(ptr) __get_kernel_bad(); 43#define LDD_KERNEL(ptr) BUILD_BUG()
47#define LDD_USER(ptr) __get_user_bad(); 44#define LDD_USER(ptr) BUILD_BUG()
48#define STD_KERNEL(x, ptr) __put_kernel_asm64(x,ptr) 45#define STD_KERNEL(x, ptr) __put_kernel_asm64(x,ptr)
49#define STD_USER(x, ptr) __put_user_asm64(x,ptr) 46#define STD_USER(x, ptr) __put_user_asm64(x,ptr)
50#define ASM_WORD_INSN ".word\t" 47#define ASM_WORD_INSN ".word\t"
@@ -94,7 +91,7 @@ struct exception_data {
94 case 2: __get_kernel_asm("ldh",ptr); break; \ 91 case 2: __get_kernel_asm("ldh",ptr); break; \
95 case 4: __get_kernel_asm("ldw",ptr); break; \ 92 case 4: __get_kernel_asm("ldw",ptr); break; \
96 case 8: LDD_KERNEL(ptr); break; \ 93 case 8: LDD_KERNEL(ptr); break; \
97 default: __get_kernel_bad(); break; \ 94 default: BUILD_BUG(); break; \
98 } \ 95 } \
99 } \ 96 } \
100 else { \ 97 else { \
@@ -103,7 +100,7 @@ struct exception_data {
103 case 2: __get_user_asm("ldh",ptr); break; \ 100 case 2: __get_user_asm("ldh",ptr); break; \
104 case 4: __get_user_asm("ldw",ptr); break; \ 101 case 4: __get_user_asm("ldw",ptr); break; \
105 case 8: LDD_USER(ptr); break; \ 102 case 8: LDD_USER(ptr); break; \
106 default: __get_user_bad(); break; \ 103 default: BUILD_BUG(); break; \
107 } \ 104 } \
108 } \ 105 } \
109 \ 106 \
@@ -136,7 +133,7 @@ struct exception_data {
136 case 2: __put_kernel_asm("sth",__x,ptr); break; \ 133 case 2: __put_kernel_asm("sth",__x,ptr); break; \
137 case 4: __put_kernel_asm("stw",__x,ptr); break; \ 134 case 4: __put_kernel_asm("stw",__x,ptr); break; \
138 case 8: STD_KERNEL(__x,ptr); break; \ 135 case 8: STD_KERNEL(__x,ptr); break; \
139 default: __put_kernel_bad(); break; \ 136 default: BUILD_BUG(); break; \
140 } \ 137 } \
141 } \ 138 } \
142 else { \ 139 else { \
@@ -145,7 +142,7 @@ struct exception_data {
145 case 2: __put_user_asm("sth",__x,ptr); break; \ 142 case 2: __put_user_asm("sth",__x,ptr); break; \
146 case 4: __put_user_asm("stw",__x,ptr); break; \ 143 case 4: __put_user_asm("stw",__x,ptr); break; \
147 case 8: STD_USER(__x,ptr); break; \ 144 case 8: STD_USER(__x,ptr); break; \
148 default: __put_user_bad(); break; \ 145 default: BUILD_BUG(); break; \
149 } \ 146 } \
150 } \ 147 } \
151 \ 148 \