From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751454AbbGIJDH (ORCPT ); Thu, 9 Jul 2015 05:03:07 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:33357 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750887AbbGIJDB (ORCPT ); Thu, 9 Jul 2015 05:03:01 -0400 Message-ID: <559E38B7.2030201@linaro.org> Date: Thu, 09 Jul 2015 17:02:47 +0800 From: Bamvor Zhang Jian User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: John Stultz CC: Arnd Bergmann , Thomas Gleixner , y2038@lists.linaro.org, lkml , Baolin Wang Subject: Re: [RFC PATCH v2 1/4] y2038: add 64bit time_t support in timeval for 32bit architecture References: <1435587807-10008-1-git-send-email-bamvor.zhangjian@linaro.org> <1435587807-10008-2-git-send-email-bamvor.zhangjian@linaro.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, John On 07/09/2015 04:09 AM, John Stultz wrote: > On Mon, Jun 29, 2015 at 7:23 AM, Bamvor Zhang Jian > 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. I add this ifdef because I got compile failure on arm platform. This file do not include the directly. And in arm64, compat.h is included implicitily. So, I am not sure what I should do here. Include in this file directly or add a this check at the beginning of this file? #ifndef is_compat_task #define is_compat_task() (0) #endif > Otherwise this looks similar to a patch Baolin (cc'ed) has been working on. Yes. regards bamvor > > thanks > -john >