diff options
author | Dave Jones <davej@redhat.com> | 2006-12-12 17:41:41 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2006-12-12 17:41:41 -0500 |
commit | c4366889dda8110247be59ca41fddb82951a8c26 (patch) | |
tree | 705c1a996bed8fd48ce94ff33ec9fd00f9b94875 /arch/ia64/lib/csum_partial_copy.c | |
parent | db2fb9db5735cc532fd4fc55e94b9a3c3750378e (diff) | |
parent | e1036502e5263851259d147771226161e5ccc85a (diff) |
Merge ../linus
Conflicts:
drivers/cpufreq/cpufreq.c
Diffstat (limited to 'arch/ia64/lib/csum_partial_copy.c')
-rw-r--r-- | arch/ia64/lib/csum_partial_copy.c | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/arch/ia64/lib/csum_partial_copy.c b/arch/ia64/lib/csum_partial_copy.c index 36866e8a5d2b..503dfe6d1450 100644 --- a/arch/ia64/lib/csum_partial_copy.c +++ b/arch/ia64/lib/csum_partial_copy.c | |||
@@ -104,9 +104,9 @@ out: | |||
104 | */ | 104 | */ |
105 | extern unsigned long do_csum(const unsigned char *, long); | 105 | extern unsigned long do_csum(const unsigned char *, long); |
106 | 106 | ||
107 | static unsigned int | 107 | __wsum |
108 | do_csum_partial_copy_from_user (const unsigned char __user *src, unsigned char *dst, | 108 | csum_partial_copy_from_user(const void __user *src, void *dst, |
109 | int len, unsigned int psum, int *errp) | 109 | int len, __wsum psum, int *errp) |
110 | { | 110 | { |
111 | unsigned long result; | 111 | unsigned long result; |
112 | 112 | ||
@@ -122,30 +122,17 @@ do_csum_partial_copy_from_user (const unsigned char __user *src, unsigned char * | |||
122 | result = do_csum(dst, len); | 122 | result = do_csum(dst, len); |
123 | 123 | ||
124 | /* add in old sum, and carry.. */ | 124 | /* add in old sum, and carry.. */ |
125 | result += psum; | 125 | result += (__force u32)psum; |
126 | /* 32+c bits -> 32 bits */ | 126 | /* 32+c bits -> 32 bits */ |
127 | result = (result & 0xffffffff) + (result >> 32); | 127 | result = (result & 0xffffffff) + (result >> 32); |
128 | return result; | 128 | return (__force __wsum)result; |
129 | } | ||
130 | |||
131 | unsigned int | ||
132 | csum_partial_copy_from_user (const unsigned char __user *src, unsigned char *dst, | ||
133 | int len, unsigned int sum, int *errp) | ||
134 | { | ||
135 | if (!access_ok(VERIFY_READ, src, len)) { | ||
136 | *errp = -EFAULT; | ||
137 | memset(dst, 0, len); | ||
138 | return sum; | ||
139 | } | ||
140 | |||
141 | return do_csum_partial_copy_from_user(src, dst, len, sum, errp); | ||
142 | } | 129 | } |
143 | 130 | ||
144 | unsigned int | 131 | __wsum |
145 | csum_partial_copy_nocheck(const unsigned char __user *src, unsigned char *dst, | 132 | csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum) |
146 | int len, unsigned int sum) | ||
147 | { | 133 | { |
148 | return do_csum_partial_copy_from_user(src, dst, len, sum, NULL); | 134 | return csum_partial_copy_from_user((__force const void __user *)src, |
135 | dst, len, sum, NULL); | ||
149 | } | 136 | } |
150 | 137 | ||
151 | EXPORT_SYMBOL(csum_partial_copy_nocheck); | 138 | EXPORT_SYMBOL(csum_partial_copy_nocheck); |