mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Li Zhong <zhong@linux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Kevin Hilman <khilman@linaro.org>
Subject: [PATCH 1/2] cputime: fix compiler warning caused by timeval_to_cputime()
Date: Sat, 23 Feb 2013 17:28:44 +0100	[thread overview]
Message-ID: <1361636925-22288-2-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1361636925-22288-1-git-send-email-fweisbec@gmail.com>

From: Li Zhong <zhong@linux.vnet.ibm.com>

Saw the following compiler warning on next tree:

kernel/itimer.c: In function 'set_cpu_itimer':
kernel/itimer.c:152:2: warning: passing argument 1 of
'timeval_to_cputime' discards 'const' qualifier from pointer target type
[enabled by default]
...

timeval_to_cputime() is always passed a constant timeval in
argument, we need to teach the nsecs based cputime implementation
about that.

Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kevin Hilman <khilman@linaro.org>
---
 include/asm-generic/cputime_nsecs.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-generic/cputime_nsecs.h b/include/asm-generic/cputime_nsecs.h
index b6485ca..a8ece9a 100644
--- a/include/asm-generic/cputime_nsecs.h
+++ b/include/asm-generic/cputime_nsecs.h
@@ -76,7 +76,7 @@ static inline void cputime_to_timespec(const cputime_t ct, struct timespec *val)
 /*
  * Convert cputime <-> timeval (msec)
  */
-static inline cputime_t timeval_to_cputime(struct timeval *val)
+static inline cputime_t timeval_to_cputime(const struct timeval *val)
 {
 	u64 ret = val->tv_sec * NSEC_PER_SEC + val->tv_usec * NSEC_PER_USEC;
 	return (__force cputime_t) ret;
-- 
1.7.5.4


  reply	other threads:[~2013-02-23 16:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-23 16:28 [PATCH 0/2] cputime: Fixes Frederic Weisbecker
2013-02-23 16:28 ` Frederic Weisbecker [this message]
2013-02-24 12:21   ` [tip:sched/urgent] cputime: Constify timeval_to_cputime(timeval) argument tip-bot for Li Zhong
2013-02-23 16:28 ` [PATCH 2/2] cputime: Use local_clock() for full dynticks cputime accounting Frederic Weisbecker
2013-02-24 12:22   ` [tip:sched/urgent] " tip-bot for Frederic Weisbecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1361636925-22288-2-git-send-email-fweisbec@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=khilman@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=zhong@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome