lkml.org 
[lkml]   [2015]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH v2 1/4] y2038: add 64bit time_t support in timeval for 32bit architecture
From
On Mon, Jun 29, 2015 at 7:23 AM, Bamvor Zhang Jian
<bamvor.zhangjian@linaro.org> wrote:
> +int get_timeval64(struct timeval64 *tv,
> + const struct __kernel_timeval __user *utv)
> +{
> + struct __kernel_timeval ktv;
> + int ret;
> +
> + ret = copy_from_user(&ktv, utv, sizeof(ktv));
> + if (ret)
> + return -EFAULT;
> +
> + tv->tv_sec = ktv.tv_sec;
> + if (!IS_ENABLED(CONFIG_64BIT)
> +#ifdef CONFIG_COMPAT
> + || is_compat_task()
> +#endif

These sorts of ifdefs are to be avoided inside of functions.

Instead, it seems is_compat_task() should be defined to 0 in the
!CONFIG_COMPAT case, so you can avoid the ifdefs and the compiler can
still optimize it out.

Otherwise this looks similar to a patch Baolin (cc'ed) has been working on.

thanks
-john


\
 
 \ /
  Last update: 2015-07-08 22:41    [W:0.119 / U:1.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site