From patchwork Mon May 11 11:16:10 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: 48244 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 282E021550 for ; Mon, 11 May 2015 11:16:27 +0000 (UTC) Received: by laat2 with SMTP id t2sf40792938laa.2 for ; Mon, 11 May 2015 04:16:26 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=CW+irYwB/5HNhnpIMac383SNxM8Js6VaZUzEEYivopE=; b=mXUFUAsmpJShjGOvKyfkghyKApeVHVQP0J11bNvN3CtvZqV30qyWsZMt5M9xG3bCZo 4Q0QM+gYhIKFQ/PeuexuixUrfI28dvLTwdd+J+LzJXnqzzXdviT7JVkVYtkgERi6g7NS 1Dr9cta9F3jWg57zrQpFHivdVa3al7vGRtRFQe4t0PBVlGGvzlxkSebzELk54knA6h3X 8eSeQ5isclQFHvDGHefDgwnk+kuk4MOqUIOtGyZ7JrP72CAgRZYg6hobwxgHqkz4KmFm cY4tbWX9pKaNuIMck3bWdffhw4Vr3GwpZ6a7fFOFjuTippxd1IhR8KxrALHSlmhDCxlr W/Qw== X-Gm-Message-State: ALoCoQkQ8X3OVgakNz24KMQQN6loslhUgBW2tte4XeaiKf5I2pP27bvScT+G24MYmvpaNJv8sUog X-Received: by 10.180.97.9 with SMTP id dw9mr7311671wib.2.1431342986162; Mon, 11 May 2015 04:16:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.41 with SMTP id p9ls558398lap.37.gmail; Mon, 11 May 2015 04:16:25 -0700 (PDT) X-Received: by 10.112.157.100 with SMTP id wl4mr7765962lbb.20.1431342985970; Mon, 11 May 2015 04:16:25 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id am2si8164796lac.130.2015.05.11.04.16.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 04:16:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by laat2 with SMTP id t2so90645648laa.1 for ; Mon, 11 May 2015 04:16:25 -0700 (PDT) X-Received: by 10.112.150.100 with SMTP id uh4mr7547452lbb.112.1431342985805; Mon, 11 May 2015 04:16:25 -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 hn6csp1443086lbb; Mon, 11 May 2015 04:16:24 -0700 (PDT) X-Received: by 10.67.24.65 with SMTP id ig1mr18221197pad.61.1431342983838; Mon, 11 May 2015 04:16:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id td3si17523604pac.221.2015.05.11.04.16.23; Mon, 11 May 2015 04:16:23 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932233AbbEKLQV (ORCPT + 28 others); Mon, 11 May 2015 07:16:21 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:33858 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753438AbbEKLQS (ORCPT ); Mon, 11 May 2015 07:16:18 -0400 Received: by pacyx8 with SMTP id yx8so107616334pac.1 for ; Mon, 11 May 2015 04:16:17 -0700 (PDT) X-Received: by 10.66.141.231 with SMTP id rr7mr18577775pab.86.1431342977867; Mon, 11 May 2015 04:16:17 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by mx.google.com with ESMTPSA id p1sm12818058pdl.60.2015.05.11.04.16.14 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 May 2015 04:16:17 -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 v3 08/22] posix-timers:Split out the guts of the syscall and change the implementation for clock_settime Date: Mon, 11 May 2015 19:16:10 +0800 Message-Id: <1431342970-29683-1-git-send-email-baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 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.215.46 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: , This patch splits out the guts of the clock_settime syscall and changes the clock_settime syscall implementation to prepare the converting to 64bit methods for the clock_settime syscall function in posix-timers.c file. Signed-off-by: Baolin Wang --- kernel/time/posix-timers.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c index f2fde32..dcc35fc 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -1072,19 +1072,25 @@ void exit_itimers(struct signal_struct *sig) } } -SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, - const struct timespec __user *, tp) +static int __clock_settime(clockid_t which_clock, struct timespec *ts) { struct k_clock *kc = clockid_to_kclock(which_clock); - struct timespec new_tp; if (!kc || !kc->clock_set) return -EINVAL; + return kc->clock_set(which_clock, ts); +} + +SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, + const struct timespec __user *, tp) +{ + struct timespec new_tp; + if (copy_from_user(&new_tp, tp, sizeof (*tp))) return -EFAULT; - return kc->clock_set(which_clock, &new_tp); + return __clock_settime(which_clock, &new_tp); } SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock,