* [Xenomai-core] [RFC][PATCH 5/5] Report ignored __xn_copy_*_user return codes
@ 2007-11-12 23:01 Jan Kiszka
0 siblings, 0 replies; only message in thread
From: Jan Kiszka @ 2007-11-12 23:01 UTC (permalink / raw)
To: Xenomai-core
[-- Attachment #1.1: Type: text/plain, Size: 357 bytes --]
As recently suggested, this patch arms the __must_check logic behind
__xn_copy_to_user, __xn_copy_from_user (not on i386 due to lacking
instrumentation of Linux service), __xn_strncpy_from_user.
This patch is only intended to point out what remains to be addressed,
the huge number of warnings make it unsuited form a merge at this -rc stage.
Jan
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: must_check-xn_copy.patch --]
[-- Type: text/x-patch; name="must_check-xn_copy.patch", Size: 4787 bytes --]
---
include/asm-generic/wrappers.h | 4 ++++
include/asm-x86/hal.h | 4 ++++
include/asm-x86/hal_32.h | 2 --
include/asm-x86/hal_64.h | 4 ----
include/asm-x86/syscall_32.h | 11 ++++-------
include/asm-x86/syscall_64.h | 11 ++++-------
6 files changed, 16 insertions(+), 20 deletions(-)
Index: xenomai/include/asm-x86/hal.h
===================================================================
--- xenomai.orig/include/asm-x86/hal.h
+++ xenomai/include/asm-x86/hal.h
@@ -46,4 +46,8 @@ extern enum rthal_ktimer_mode rthal_ktim
#include "hal_64.h"
#endif
+long __must_check rthal_strncpy_from_user(char *dst,
+ const char __user *src,
+ long count);
+
#endif /* !_XENO_ASM_X86_HAL_H */
Index: xenomai/include/asm-x86/hal_32.h
===================================================================
--- xenomai.orig/include/asm-x86/hal_32.h
+++ xenomai/include/asm-x86/hal_32.h
@@ -222,8 +222,6 @@ static inline void rthal_setup_oneshot_a
#endif /* !__cplusplus */
-long rthal_strncpy_from_user(char *dst, const char __user * src, long count);
-
void rthal_latency_above_max(struct pt_regs *regs);
#endif /* !_XENO_ASM_X86_HAL_32_H */
Index: xenomai/include/asm-x86/hal_64.h
===================================================================
--- xenomai.orig/include/asm-x86/hal_64.h
+++ xenomai/include/asm-x86/hal_64.h
@@ -138,8 +138,4 @@ static inline void rthal_setup_oneshot_a
#endif /* !__cplusplus */
-long rthal_strncpy_from_user(char *dst,
- const char __user *src,
- long count);
-
#endif /* !_XENO_ASM_X86_HAL_64_H */
Index: xenomai/include/asm-x86/syscall_32.h
===================================================================
--- xenomai.orig/include/asm-x86/syscall_32.h
+++ xenomai/include/asm-x86/syscall_32.h
@@ -47,13 +47,10 @@
#define __xn_mux_op(regs) ((__xn_reg_mux(regs) >> 24) & 0xff)
/* Our own set of copy-to/from-user macros which must bypass
- might_sleep() checks. The caller cannot fault and is expected to
- have checked for bad range before using the copy macros, so we
- should not have to care about the result. */
-#define __xn_copy_from_user(task,dstP,srcP,n) \
- ({ int __err__ = __copy_from_user_inatomic(dstP,srcP,n); __err__; })
-#define __xn_copy_to_user(task,dstP,srcP,n) \
- ({ int __err__ = __copy_to_user_inatomic(dstP,srcP,n); __err__; })
+ might_sleep() checks. The caller is expected to have checked
+ for bad range before using the copy macros. */
+#define __xn_copy_from_user(task,dstP,srcP,n) __copy_from_user_inatomic(dstP,srcP,n)
+#define __xn_copy_to_user(task,dstP,srcP,n) __copy_to_user_inatomic(dstP,srcP,n)
#define __xn_put_user(task,src,dstP) __put_user(src,dstP)
#define __xn_get_user(task,dst,srcP) __get_user(dst,srcP)
#define __xn_strncpy_from_user(task,dstP,srcP,n) wrap_strncpy_from_user(dstP,srcP,n)
Index: xenomai/include/asm-x86/syscall_64.h
===================================================================
--- xenomai.orig/include/asm-x86/syscall_64.h
+++ xenomai/include/asm-x86/syscall_64.h
@@ -47,13 +47,10 @@
#define __xn_mux_op(regs) ((__xn_reg_mux(regs) >> 24) & 0xff)
/* Our own set of copy-to/from-user macros which must bypass
- might_sleep() checks. The caller cannot fault and is expected to
- have checked for bad range before using the copy macros, so we
- should not have to care about the result. */
-#define __xn_copy_from_user(task,dstP,srcP,n) \
- ({ int __err__ = __copy_from_user_inatomic(dstP,srcP,n); __err__; })
-#define __xn_copy_to_user(task,dstP,srcP,n) \
- ({ int __err__ = __copy_to_user_inatomic(dstP,srcP,n); __err__; })
+ might_sleep() checks. The caller is expected to have checked
+ for bad range before using the copy macros. */
+#define __xn_copy_from_user(task,dstP,srcP,n) __copy_from_user_inatomic(dstP,srcP,n)
+#define __xn_copy_to_user(task,dstP,srcP,n) __copy_to_user_inatomic(dstP,srcP,n)
#define __xn_put_user(task,src,dstP) __put_user(src,dstP)
#define __xn_get_user(task,dst,srcP) __get_user(dst,srcP)
#define __xn_strncpy_from_user(task,dstP,srcP,n) rthal_strncpy_from_user(dstP,srcP,n)
Index: xenomai/include/asm-generic/wrappers.h
===================================================================
--- xenomai.orig/include/asm-generic/wrappers.h
+++ xenomai/include/asm-generic/wrappers.h
@@ -183,6 +183,10 @@ void show_stack(struct task_struct *task
#define __deprecated __attribute__((deprecated))
#endif
+#ifndef __must_check
+#define __must_check
+#endif
+
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) */
#define compat_module_param_array(name, type, count, perm) \
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-11-12 23:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-12 23:01 [Xenomai-core] [RFC][PATCH 5/5] Report ignored __xn_copy_*_user return codes Jan Kiszka
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.