[PATCH wip/dovetail 1/1] cobalt: Remove duplicate timespec/itimerspec copy helpers

Florian Bezdeka florian.bezdeka at siemens.com
Fri May 7 17:18:30 CEST 2021


The variant of such helpers which are using a temporary element on the
stack work in both worlds, so on systems with 4 and 8 byte time_t.
To keep the code as simple as possible we can remove the
__BITS_PER_LONG == 64 implementation.

Signed-off-by: Florian Bezdeka <florian.bezdeka at siemens.com>
---
 .../include/asm-generic/xenomai/syscall.h     | 31 -------------------
 1 file changed, 31 deletions(-)

diff --git a/kernel/cobalt/include/asm-generic/xenomai/syscall.h b/kernel/cobalt/include/asm-generic/xenomai/syscall.h
index 194583c18..117bb3ff8 100644
--- a/kernel/cobalt/include/asm-generic/xenomai/syscall.h
+++ b/kernel/cobalt/include/asm-generic/xenomai/syscall.h
@@ -75,41 +75,12 @@ static inline int cobalt_strncpy_from_user(char *dst, const char __user *src,
 	return __xn_strncpy_from_user(dst, src, count);
 }
 
-#if __BITS_PER_LONG == 64
 
 /*
  * NOTE: those copy helpers won't work in compat mode: use
  * sys32_get_*(), sys32_put_*() instead.
  */
 
-static inline int cobalt_get_u_timespec(struct timespec64 *dst,
-			const struct __user_old_timespec __user *src)
-{
-	return cobalt_copy_from_user(dst, src, sizeof(*dst));
-}
-
-static inline int cobalt_put_u_timespec(
-	struct __user_old_timespec __user *dst,
-	const struct timespec64 *src)
-{
-	return cobalt_copy_to_user(dst, src, sizeof(*dst));
-}
-
-static inline int cobalt_get_u_itimerspec(struct itimerspec64 *dst,
-			const struct __user_old_itimerspec __user *src)
-{
-	return cobalt_copy_from_user(dst, src, sizeof(*dst));
-}
-
-static inline int cobalt_put_u_itimerspec(
-	struct __user_old_itimerspec __user *dst,
-	const struct itimerspec64 *src)
-{
-	return cobalt_copy_to_user(dst, src, sizeof(*dst));
-}
-
-#else /* __BITS_PER_LONG == 32 */
-
 static inline int cobalt_get_u_timespec(struct timespec64 *dst,
 			const struct __user_old_timespec __user *src)
 {
@@ -175,8 +146,6 @@ static inline int cobalt_put_u_itimerspec(
 	return cobalt_copy_to_user(dst, &u_its, sizeof(*dst));
 }
 
-#endif
-
 /* 32bit syscall emulation */
 #define __COBALT_COMPAT_BIT	0x1
 /* 32bit syscall emulation - extended form */
-- 
2.31.1




More information about the Xenomai mailing list