From patchwork Mon May 11 11:29: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: 48271 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 34B1B21550 for ; Mon, 11 May 2015 11:30:19 +0000 (UTC) Received: by labgx2 with SMTP id gx2sf40959770lab.1 for ; Mon, 11 May 2015 04:30:18 -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=Iq8BfKtmILukEefPUHn2vkyWVflPDukTOrpsL969AfQ=; b=Kr5zllHRr6McA7GSHVkrJ6eKpmt/mu1mppTy5QlTfJe9laci/EOmkqAC63Ii1VYR49 MpE//lxEu/OeO257lBZ7rau36J6/HgCO2gI+FcGrbfuiZHKsTIgAov8W3ZUvbi58wBRl t9Q3bHe/ewyGw/Is+YEeit+C3CCldF+7QgKwREX/bmdD+P9XzlIliMh8m+JPWZ8RZIOl G2JAmtDUzoB2J8xnutl2pZXxhRVvy6KK8NlaASbO9sIVxeoezdznjxxYwl824qHwxpK9 OY7lyCIueKgSj5GfzcOhTLkKsxoNw7mnxvxUjqz5V4u4AI7QSDjZoO0iZ3gEgd+NbMBu 4jlg== X-Gm-Message-State: ALoCoQkM4O0EmE1x8axLxZPRR7VHGMV+e+zhzYt4VRwpduq5PrRPuBFuv3gapM5q5QrlRA4RlDID X-Received: by 10.180.98.130 with SMTP id ei2mr7348513wib.0.1431343818165; Mon, 11 May 2015 04:30:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.100 with SMTP id j4ls629699lah.92.gmail; Mon, 11 May 2015 04:30:17 -0700 (PDT) X-Received: by 10.112.13.6 with SMTP id d6mr7580573lbc.117.1431343817911; Mon, 11 May 2015 04:30:17 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id g10si8193816lam.78.2015.05.11.04.30.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 04:30:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbbuc2 with SMTP id uc2so91401861lbb.2 for ; Mon, 11 May 2015 04:30:17 -0700 (PDT) X-Received: by 10.153.8.167 with SMTP id dl7mr7756245lad.86.1431343817817; Mon, 11 May 2015 04:30:17 -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 hn6csp1449165lbb; Mon, 11 May 2015 04:30:16 -0700 (PDT) X-Received: by 10.66.228.130 with SMTP id si2mr18408638pac.92.1431343816045; Mon, 11 May 2015 04:30:16 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uv9si11755385pac.126.2015.05.11.04.30.07; Mon, 11 May 2015 04:30:16 -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 S1754037AbbEKLaC (ORCPT + 28 others); Mon, 11 May 2015 07:30:02 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:36861 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753865AbbEKLaA (ORCPT ); Mon, 11 May 2015 07:30:00 -0400 Received: by pabsx10 with SMTP id sx10so107882340pab.3 for ; Mon, 11 May 2015 04:29:59 -0700 (PDT) X-Received: by 10.68.218.9 with SMTP id pc9mr18295653pbc.2.1431343799593; Mon, 11 May 2015 04:29:59 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by mx.google.com with ESMTPSA id ho10sm12845835pbc.27.2015.05.11.04.29.56 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 May 2015 04:29:59 -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 22/22] k_clock:Remove the 32bit methods with timespec/itimerspec type Date: Mon, 11 May 2015 19:29:52 +0800 Message-Id: <1431343792-30237-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.170 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: , All of the k_clock users have been converted to the new methods. This patch removes the older methods with timepsec/itimerspec type. As a result, the k_clock structure is ready for the year 2038. Signed-off-by: Baolin Wang --- include/linux/posix-timers.h | 9 ----- kernel/time/posix-timers.c | 74 +++--------------------------------------- 2 files changed, 5 insertions(+), 78 deletions(-) diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index 9a5a211..2b47d04 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h @@ -97,29 +97,20 @@ struct k_itimer { }; struct k_clock { - int (*clock_getres) (const clockid_t which_clock, struct timespec *tp); int (*clock_getres64) (const clockid_t which_clock, struct timespec64 *tp); - int (*clock_set) (const clockid_t which_clock, - const struct timespec *tp); int (*clock_set64) (const clockid_t which_clock, const struct timespec64 *tp); - int (*clock_get) (const clockid_t which_clock, struct timespec * tp); int (*clock_get64) (const clockid_t which_clock, struct timespec64 *tp); int (*clock_adj) (const clockid_t which_clock, struct timex *tx); int (*timer_create) (struct k_itimer *timer); int (*nsleep) (const clockid_t which_clock, int flags, struct timespec *, struct timespec __user *); long (*nsleep_restart) (struct restart_block *restart_block); - int (*timer_set) (struct k_itimer * timr, int flags, - struct itimerspec * new_setting, - struct itimerspec * old_setting); int (*timer_set64) (struct k_itimer *timr, int flags, struct itimerspec64 *new_setting, struct itimerspec64 *old_setting); int (*timer_del) (struct k_itimer * timr); #define TIMER_RETRY 1 - void (*timer_get) (struct k_itimer * timr, - struct itimerspec * cur_setting); void (*timer_get64) (struct k_itimer *timr, struct itimerspec64 *cur_setting); }; diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c index a5bf0cf..845955f 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -140,7 +140,6 @@ static int common_timer_del(struct k_itimer *timer); static enum hrtimer_restart posix_timer_fn(struct hrtimer *data); static struct k_itimer *__lock_timer(timer_t timer_id, unsigned long *flags); -static struct k_clock *clockid_to_kclock(const clockid_t id); #define lock_timer(tid, flags) \ ({ struct k_itimer *__timr; \ @@ -514,57 +513,6 @@ static struct pid *good_sigevent(sigevent_t * event) return task_pid(rtn); } -static int default_timer_get64(struct k_itimer *timr, - struct itimerspec64 *cur_setting64) -{ - struct itimerspec cur_setting; - struct k_clock *kc = clockid_to_kclock(timr->it_clock); - - kc->timer_get(timr, &cur_setting); - return 0; -} - -static int default_timer_set64(struct k_itimer *timr, int flags, - struct itimerspec64 *new_setting64, - struct itimerspec64 *old_setting64) -{ - struct k_clock *kc = clockid_to_kclock(timr->it_clock); - struct itimerspec new_setting, old_setting; - - kc->timer_set(timr, flags, &new_setting, &old_setting); - return 0; -} - -static int default_clock_set64(const clockid_t which_clock, - const struct timespec64 *tp64) -{ - struct k_clock *kc = clockid_to_kclock(which_clock); - struct timespec tp; - - kc->clock_set(which_clock, &tp); - return 0; -} - -static int default_clock_get64(const clockid_t which_clock, - struct timespec64 *tp64) -{ - struct k_clock *kc = clockid_to_kclock(which_clock); - struct timespec tp; - - kc->clock_get(which_clock, &tp); - return 0; -} - -static int default_clock_getres64(const clockid_t which_clock, - struct timespec64 *tp64) -{ - struct k_clock *kc = clockid_to_kclock(which_clock); - struct timespec tp; - - kc->clock_getres(which_clock, &tp); - return 0; -} - void posix_timers_register_clock(const clockid_t clock_id, struct k_clock *new_clock) { @@ -574,28 +522,17 @@ void posix_timers_register_clock(const clockid_t clock_id, return; } - if (!new_clock->clock_get && !new_clock->clock_get64) { - printk(KERN_WARNING "POSIX clock id %d lacks clock_get() and clock_get64()\n", + if (!new_clock->clock_get64) { + printk(KERN_WARNING "POSIX clock id %d lacks clock_get64()\n", clock_id); return; } - if (!new_clock->clock_getres && !new_clock->clock_getres64) { - printk(KERN_WARNING "POSIX clock id %d lacks clock_getres() and clock_getres64()\n", + if (!new_clock->clock_getres64) { + printk(KERN_WARNING "POSIX clock id %d lacks clock_getres64()\n", clock_id); return; } - if (new_clock->timer_get && !new_clock->timer_get64) - new_clock->timer_get64 = default_timer_get64; - if (new_clock->timer_set && !new_clock->timer_set64) - new_clock->timer_set64 = default_timer_set64; - if (new_clock->clock_set && !new_clock->clock_set64) - new_clock->clock_set64 = default_clock_set64; - if (new_clock->clock_get && !new_clock->clock_get64) - new_clock->clock_get64 = default_clock_get64; - if (new_clock->clock_getres && !new_clock->clock_getres64) - new_clock->clock_getres64 = default_clock_getres64; - posix_clocks[clock_id] = *new_clock; } EXPORT_SYMBOL_GPL(posix_timers_register_clock); @@ -642,8 +579,7 @@ static struct k_clock *clockid_to_kclock(const clockid_t id) return (id & CLOCKFD_MASK) == CLOCKFD ? &clock_posix_dynamic : &clock_posix_cpu; - if (id >= MAX_CLOCKS || (!posix_clocks[id].clock_getres - && !posix_clocks[id].clock_getres64)) + if (id >= MAX_CLOCKS || !posix_clocks[id].clock_getres64) return NULL; return &posix_clocks[id]; }