From patchwork Mon May 11 11:14:52 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: 48240 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 80E7321550 for ; Mon, 11 May 2015 11:15:14 +0000 (UTC) Received: by lbbrr5 with SMTP id rr5sf37756143lbb.3 for ; Mon, 11 May 2015 04:15:13 -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=5Z0Lc2lFD/uvLCeGZGkJ41HhLQCc38OuKy9rrY6Qy+k=; b=B0Hhtbi55yPjiQ8p+gLpKiW72IfMS1Ov+KS+NXFjVJKVSF5ycrlSvrlZ4DzZq/l69M oOssIHvER4IeQHhy0ilUvBQ+wJ92x/cvavluBbZfLrFT6HVAFz10idK7SHwzSVzi1hgN Kbp3acNrQr0Z9Gv/aV45w1smOgPA7fwXT45C78JB5wjjrbYhvu52RM3gIBVe7HKfzLoA XSHzts7sBLD9hOpyUoiA3W4CL60EVmeYYZ5NIl09Ejh5KGBg9rQtrnGTTDfr0CbBX/1I 4xlz0Kk071GpeU+qxACVfrJ0rczDOqL11nIalymxc4cDYjZzCSt2VKdA8xftl2g0w/HF 3gjg== X-Gm-Message-State: ALoCoQlE01Sv0PU6aD6/+ZbJeLznElvxEwfFPZzH+rmuIMyOmyEjM+S84uHUWg/oj9SQ/aJa9hc1 X-Received: by 10.112.142.170 with SMTP id rx10mr7266375lbb.12.1431342913447; Mon, 11 May 2015 04:15:13 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.8.171 with SMTP id dl11ls570895lad.55.gmail; Mon, 11 May 2015 04:15:13 -0700 (PDT) X-Received: by 10.112.185.100 with SMTP id fb4mr7750924lbc.79.1431342913279; Mon, 11 May 2015 04:15:13 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id g10si8174306lam.78.2015.05.11.04.15.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 04:15:13 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbbuc2 with SMTP id uc2so91161777lbb.2 for ; Mon, 11 May 2015 04:15:13 -0700 (PDT) X-Received: by 10.112.161.226 with SMTP id xv2mr7745039lbb.106.1431342912992; Mon, 11 May 2015 04:15:12 -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 hn6csp1442507lbb; Mon, 11 May 2015 04:15:12 -0700 (PDT) X-Received: by 10.69.10.196 with SMTP id ec4mr18337780pbd.69.1431342911332; Mon, 11 May 2015 04:15:11 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s7si17601724pdl.14.2015.05.11.04.15.10; Mon, 11 May 2015 04:15:11 -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 S932162AbbEKLPB (ORCPT + 28 others); Mon, 11 May 2015 07:15:01 -0400 Received: from mail-pd0-f171.google.com ([209.85.192.171]:34272 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753878AbbEKLO7 (ORCPT ); Mon, 11 May 2015 07:14:59 -0400 Received: by pdbqa5 with SMTP id qa5so141899796pdb.1 for ; Mon, 11 May 2015 04:14:58 -0700 (PDT) X-Received: by 10.70.37.9 with SMTP id u9mr18116747pdj.50.1431342898775; Mon, 11 May 2015 04:14:58 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by mx.google.com with ESMTPSA id lc14sm12861434pab.33.2015.05.11.04.14.56 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 May 2015 04:14:58 -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 04/22] posix-timers:Split out the guts of the syscall and change the implementation for timer_gettime Date: Mon, 11 May 2015 19:14:52 +0800 Message-Id: <1431342892-29529-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.182 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 timer_gettime syscall and changes the timer_gettime syscall implementation to prepare the converting to 64bit methods for the timer_gettime syscall function in posix-timers.c file. 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 31ea01f..9df664a 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -766,11 +766,8 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting) cur_setting->it_value = ktime_to_timespec(remaining); } -/* Get the time remaining on a POSIX.1b interval timer. */ -SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id, - struct itimerspec __user *, setting) +static int __timer_gettime(timer_t timer_id, struct itimerspec *cur_setting) { - struct itimerspec cur_setting; struct k_itimer *timr; struct k_clock *kc; unsigned long flags; @@ -784,9 +781,18 @@ SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id, if (WARN_ON_ONCE(!kc || !kc->timer_get)) ret = -EINVAL; else - kc->timer_get(timr, &cur_setting); + kc->timer_get(timr, cur_setting); unlock_timer(timr, flags); + return ret; +} + +/* Get the time remaining on a POSIX.1b interval timer. */ +SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id, + struct itimerspec __user *, setting) +{ + struct itimerspec cur_setting; + int ret = __timer_gettime(timer_id, &cur_setting); if (!ret && copy_to_user(setting, &cur_setting, sizeof (cur_setting))) return -EFAULT;