From patchwork Fri Jun 12 07:48:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 49795 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D5C42228DB for ; Fri, 12 Jun 2015 07:50:54 +0000 (UTC) Received: by wgla2 with SMTP id a2sf7414482wgl.1 for ; Fri, 12 Jun 2015 00:50:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=FLiTg27y58XTJhu7gR0V/pfNbfIoIcPnrPMJOBSYO+k=; b=hV0A+9hC5kpQqwUUz3fRa6dhPbFJLZ+PrIxkgr2UGA5BIK53WGpqC3VOkXE6IRuwUQ 91Boz9iIalPdlcVgGiwE4y7x6T5ttI1bhpepcBataIvZ7tRhRgN20TsaQixfn6CSujLO aML45SjrD60+XdmYUHQNFz08JpvzaSdvLW6DbmNSHDRCkH2Kj8R7I2HMHvWtAA8uN/R5 wAl4smhBb/f5Vbs8I5SXCcKDeKLVeRXVeONd6G0nAdBp/6NmG1vrqIwabuMrHddTNTuE 2Hch0qKmzshvu2VVegrWIilw/MRnG/JxQdh4LhkPXpixXoSoH8Mv3oo1fMq6QcEwRTpw 5bSQ== X-Gm-Message-State: ALoCoQlqq0D/4xEcEIrqBCinj9lq8j9LJiNgejTMQMrBxClNVIUntSfXA/UHRCIZrBUBBM+S07dP X-Received: by 10.181.11.197 with SMTP id ek5mr2839399wid.4.1434095453155; Fri, 12 Jun 2015 00:50:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.97 with SMTP id c1ls504516laf.66.gmail; Fri, 12 Jun 2015 00:50:52 -0700 (PDT) X-Received: by 10.112.25.39 with SMTP id z7mr14144982lbf.102.1434095452964; Fri, 12 Jun 2015 00:50:52 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id cy4si2737273lac.57.2015.06.12.00.50.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jun 2015 00:50:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbcmx3 with SMTP id mx3so15400702lbc.1 for ; Fri, 12 Jun 2015 00:50:52 -0700 (PDT) X-Received: by 10.112.97.194 with SMTP id ec2mr13832781lbb.88.1434095452879; Fri, 12 Jun 2015 00:50:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp356272lbb; Fri, 12 Jun 2015 00:50:51 -0700 (PDT) X-Received: by 10.66.102.5 with SMTP id fk5mr21016907pab.43.1434095451192; Fri, 12 Jun 2015 00:50:51 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vx6si1869987pab.220.2015.06.12.00.50.49; Fri, 12 Jun 2015 00:50:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754729AbbFLHuo (ORCPT + 29 others); Fri, 12 Jun 2015 03:50:44 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:34600 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754584AbbFLHui (ORCPT ); Fri, 12 Jun 2015 03:50:38 -0400 Received: by pdbki1 with SMTP id ki1so19676441pdb.1 for ; Fri, 12 Jun 2015 00:50:37 -0700 (PDT) X-Received: by 10.70.124.165 with SMTP id mj5mr2394875pdb.159.1434095437689; Fri, 12 Jun 2015 00:50:37 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by mx.google.com with ESMTPSA id yv6sm2734372pac.29.2015.06.12.00.50.35 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jun 2015 00:50:37 -0700 (PDT) From: Baolin Wang To: tglx@linutronix.de Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, baolin.wang@linaro.org, y2038@lists.linaro.org Subject: [PATCH v5 14/24] posix-timers: Factor out the guts of 'clcok_getres' for reusing Date: Fri, 12 Jun 2015 15:48:29 +0800 Message-Id: <35d51406457a01a843e1d5e9791196599ddf7713.1434079263.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <647dcc7ede88d9d95a6f9a2878487d46c233fb2a.1434079262.git.baolin.wang@linaro.org> References: <647dcc7ede88d9d95a6f9a2878487d46c233fb2a.1434079262.git.baolin.wang@linaro.org> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: baolin.wang@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In order to reuse the very same logic for the year 2038 safe syscalls which we need to introduce for 32bit system, factor out the guts of the 'clock_getres' syscall. Signed-off-by: Baolin Wang --- kernel/time/posix-timers.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c index 021cd8f..a5207f0 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -1187,17 +1187,23 @@ SYSCALL_DEFINE2(clock_adjtime, const clockid_t, which_clock, return err; } -SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, - struct timespec __user *, tp) +static int __clock_getres(clockid_t which_clock, struct timespec *ts) { struct k_clock *kc = clockid_to_kclock(which_clock); - struct timespec rtn_tp; - int error; if (!kc) return -EINVAL; - error = kc->clock_getres(which_clock, &rtn_tp); + return kc->clock_getres(which_clock, ts); +} + +SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, + struct timespec __user *, tp) +{ + struct timespec rtn_tp; + int error; + + error = __clock_getres(which_clock, &rtn_tp); if (!error && tp && copy_to_user(tp, &rtn_tp, sizeof (rtn_tp))) error = -EFAULT;