From patchwork Mon Jun 1 11:56:48 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: 49308 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6F565218FC for ; Mon, 1 Jun 2015 11:57:41 +0000 (UTC) Received: by wibut5 with SMTP id ut5sf5189357wib.0 for ; Mon, 01 Jun 2015 04:57:40 -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=n4teAX8PRgvfJ3j8VL6N/4pwkk/ZZ6/VWiP7aWaiBd0=; b=Kvrev5uzY1da1jQaTxfPhu9HVQVA6ZCB8DN5Kt/XMoYJBTmAJbEWsBI6DNDO1zrrW5 FgFQJ56ORoa6bl9Fkw62Z6hoyzlUYjzqaOxdJ5+2iyVf/5mdQnMV/Gb+YMv9Al3ekRCN 3H4nRb2ZMmI2xx8XCLaBwFOwa3se3t2pEZdPYW79AXtfdGh2Gmdxo47qo5HUWZpHtMYN sAe2WQsv8sSuYxI1wOYzEYaLDyg/8CIGLtrKcmKa5Ez/3atZKBu4q5UvlHjYWVPehuP7 s0a5k1aSxoXnwY/qwAWqkxGevp7VqRIJ0DsS/4xZGwDog+rIZwCRjzSgSHSWvvv8tbKk XIqA== X-Gm-Message-State: ALoCoQnm7qGTDysM5T138+9RhNdHOibxIqkb30WOgLFq2UWV9RJbr5FfNPZigs82L+SxIOy7nqWm X-Received: by 10.152.8.17 with SMTP id n17mr20643929laa.0.1433159860533; Mon, 01 Jun 2015 04:57:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.135 with SMTP id e7ls679929lam.79.gmail; Mon, 01 Jun 2015 04:57:40 -0700 (PDT) X-Received: by 10.112.28.74 with SMTP id z10mr2702506lbg.48.1433159860364; Mon, 01 Jun 2015 04:57:40 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id x10si12119761lbo.118.2015.06.01.04.57.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jun 2015 04:57:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbbqq2 with SMTP id qq2so82609543lbb.3 for ; Mon, 01 Jun 2015 04:57:40 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr11198974lac.41.1433159860142; Mon, 01 Jun 2015 04:57:40 -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 hn6csp2258695lbb; Mon, 1 Jun 2015 04:57:39 -0700 (PDT) X-Received: by 10.70.49.73 with SMTP id s9mr39285906pdn.149.1433159858419; Mon, 01 Jun 2015 04:57:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pw7si19348853pac.16.2015.06.01.04.57.36; Mon, 01 Jun 2015 04:57:38 -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 S1753031AbbFAL5Y (ORCPT + 28 others); Mon, 1 Jun 2015 07:57:24 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:35797 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752907AbbFAL5C (ORCPT ); Mon, 1 Jun 2015 07:57:02 -0400 Received: by pdbnf5 with SMTP id nf5so44983186pdb.2 for ; Mon, 01 Jun 2015 04:57:02 -0700 (PDT) X-Received: by 10.66.66.173 with SMTP id g13mr40612787pat.155.1433159822231; Mon, 01 Jun 2015 04:57:02 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by mx.google.com with ESMTPSA id y1sm2240310pdy.2.2015.06.01.04.56.59 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jun 2015 04:57:01 -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 v4 11/25] posix-timers:Change the implementation for clock_settime syscall function Date: Mon, 1 Jun 2015 19:56:48 +0800 Message-Id: <1433159808-4962-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.217.174 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 c034a53..9912745 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -1082,19 +1082,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,