Commit a56f881f authored by Florian Bezdeka's avatar Florian Bezdeka Committed by Jan Kiszka
Browse files

cobalt: Remove duplicate timespec/itimerspec copy helpers



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: default avatarFlorian Bezdeka <florian.bezdeka@siemens.com>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent fc032c39
...@@ -82,41 +82,12 @@ static inline int cobalt_strncpy_from_user(char *dst, const char __user *src, ...@@ -82,41 +82,12 @@ static inline int cobalt_strncpy_from_user(char *dst, const char __user *src,
return __xn_strncpy_from_user(dst, src, count); return __xn_strncpy_from_user(dst, src, count);
} }
#if __BITS_PER_LONG == 64
/* /*
* NOTE: those copy helpers won't work in compat mode: use * NOTE: those copy helpers won't work in compat mode: use
* sys32_get_*(), sys32_put_*() instead. * 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, static inline int cobalt_get_u_timespec(struct timespec64 *dst,
const struct __user_old_timespec __user *src) const struct __user_old_timespec __user *src)
{ {
...@@ -182,8 +153,6 @@ static inline int cobalt_put_u_itimerspec( ...@@ -182,8 +153,6 @@ static inline int cobalt_put_u_itimerspec(
return cobalt_copy_to_user(dst, &u_its, sizeof(*dst)); return cobalt_copy_to_user(dst, &u_its, sizeof(*dst));
} }
#endif
/* 32bit syscall emulation */ /* 32bit syscall emulation */
#define __COBALT_COMPAT_BIT 0x1 #define __COBALT_COMPAT_BIT 0x1
/* 32bit syscall emulation - extended form */ /* 32bit syscall emulation - extended form */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment