public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, suparna@in.ibm.com, linux-aio@kvack.org
Subject: [1/2] use const in time.h unit conversion functions
Date: Tue, 1 Jun 2004 18:24:29 -0700	[thread overview]
Message-ID: <20040602012429.GV2093@holomorphy.com> (raw)
In-Reply-To: <20040601021539.413a7ad7.akpm@osdl.org>

On Tue, Jun 01, 2004 at 02:15:39AM -0700, Andrew Morton wrote:
> - NFS server udpates
> - md updates
> - big x86 dmi_scan.c cleanup
> - merged perfctr.  No documentation though :(
> - cris architecture update

The time conversion functions may have const args, which is in fact
useful for when they are passed const variables as arguments so as
to avoid discarding qualifiers from pointer types warnings. This is
a preparatory cleanup for a minor aio bugfix.

Index: timer-2.6.7-rc2/include/linux/time.h
===================================================================
--- timer-2.6.7-rc2.orig/include/linux/time.h	2004-05-29 23:26:19.000000000 -0700
+++ timer-2.6.7-rc2/include/linux/time.h	2004-06-01 16:02:01.000000000 -0700
@@ -184,7 +184,7 @@
  * Avoid unnecessary multiplications/divisions in the
  * two most common HZ cases:
  */
-static inline unsigned int jiffies_to_msecs(unsigned long j)
+static inline unsigned int jiffies_to_msecs(const unsigned long j)
 {
 #if HZ <= 1000 && !(1000 % HZ)
 	return (1000 / HZ) * j;
@@ -194,7 +194,7 @@
 	return (j * 1000) / HZ;
 #endif
 }
-static inline unsigned long msecs_to_jiffies(unsigned int m)
+static inline unsigned long msecs_to_jiffies(const unsigned int m)
 {
 #if HZ <= 1000 && !(1000 % HZ)
 	return (m + (1000 / HZ) - 1) / (1000 / HZ);
@@ -217,7 +217,7 @@
  * value to a scaled second value.
  */
 static __inline__ unsigned long
-timespec_to_jiffies(struct timespec *value)
+timespec_to_jiffies(const struct timespec *value)
 {
 	unsigned long sec = value->tv_sec;
 	long nsec = value->tv_nsec + TICK_NSEC - 1;
@@ -233,7 +233,7 @@
 }
 
 static __inline__ void
-jiffies_to_timespec(unsigned long jiffies, struct timespec *value)
+jiffies_to_timespec(const unsigned long jiffies, struct timespec *value)
 {
 	/*
 	 * Convert jiffies to nanoseconds and separate with
@@ -256,7 +256,7 @@
  * instruction above the way it was done above.
  */
 static __inline__ unsigned long
-timeval_to_jiffies(struct timeval *value)
+timeval_to_jiffies(const struct timeval *value)
 {
 	unsigned long sec = value->tv_sec;
 	long usec = value->tv_usec;
@@ -271,7 +271,7 @@
 }
 
 static __inline__ void
-jiffies_to_timeval(unsigned long jiffies, struct timeval *value)
+jiffies_to_timeval(const unsigned long jiffies, struct timeval *value)
 {
 	/*
 	 * Convert jiffies to nanoseconds and separate with

  parent reply	other threads:[~2004-06-02  1:24 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-01  9:15 2.6.7-rc2-mm1 Andrew Morton
2004-06-01  9:59 ` 2.6.7-rc2-mm1 Alexander Gran
2004-06-01 11:28   ` 2.6.7-rc2-mm1 AKIYAMA Nobuyuki
2004-06-01 11:39     ` 2.6.7-rc2-mm1 Alexander Gran
2004-06-01 16:07     ` 2.6.7-rc2-mm1 Ari Pollak
2004-06-01 16:22     ` 2.6.7-rc2-mm1 Ari Pollak
2004-06-01 10:00 ` 2.6.7-rc2-mm1 Gabriel Ebner
2004-06-01 11:05   ` 2.6.7-rc2-mm1 Andrey Panin
2004-06-01 13:58     ` 2.6.7-rc2-mm1 Gabriel Ebner
2004-06-01 14:05     ` 2.6.7-rc2-mm1 Jan Killius
2004-06-01 10:29 ` 2.6.7-rc2-mm1 Christoph Hellwig
2004-06-01 13:43   ` 2.6.7-rc2-mm1 Mikael Pettersson
2004-06-01 13:57     ` 2.6.7-rc2-mm1 Christoph Hellwig
2004-06-01 14:14       ` 2.6.7-rc2-mm1 Mikael Pettersson
2004-06-01 10:48 ` 2.6.7-rc2-mm1 Dominik Karall
2004-06-01 11:24   ` 2.6.7-rc2-mm1 William Lee Irwin III
2004-06-01 11:37     ` 2.6.7-rc2-mm1 William Lee Irwin III
2004-06-02 10:18     ` 2.6.7-rc2-mm1 Paul Jackson
2004-06-02 10:23       ` 2.6.7-rc2-mm1 Andrew Morton
2004-06-05 11:07       ` 2.6.7-rc2-mm1 Matthias Urlichs
2004-06-06  8:02         ` 2.6.7-rc2-mm1 Paul Jackson
2004-06-01 11:26 ` 2.6.7-rc2-mm1 William Lee Irwin III
2004-06-01 11:36   ` 2.6.7-rc2-mm1 Keith Owens
2004-06-01 11:26 ` 2.6.7-rc2-mm1 Andy Lutomirski
2004-06-01 11:29 ` 2.6.7-rc2-mm1 William Lee Irwin III
2004-06-01 16:24   ` 2.6.7-rc2-mm1 Mikael Pettersson
2004-06-01 11:51 ` 2.6.7-rc2-mm1 Alexander Gran
2004-06-01 12:19   ` 2.6.7-rc2-mm1 Eric BEGOT
2004-06-01 16:19     ` 2.6.7-rc2-mm1 Adrian Bunk
2004-06-01 21:18       ` 2.6.7-rc2-mm1 Chris Wedgwood
2004-06-01 21:36   ` 2.6.7-rc2-mm1 Andrew Morton
2004-06-01 21:36     ` 2.6.7-rc2-mm1 David S. Miller
2004-06-01 22:21       ` 2.6.7-rc2-mm1 Alexander Gran
2004-06-01 21:45   ` 2.6.7-rc2-mm1 Alex Romosan
2004-06-01 14:55 ` 2.6.7-rc2-mm1: gcc 2.95 uaccess.h warnings Adrian Bunk
2004-06-01 15:03   ` Linus Torvalds
2004-06-01 16:10     ` Adrian Bunk
2004-06-01 16:07 ` 2.6.7-rc2-mm1 Norberto Bensa
2004-06-01 16:07 ` 2.6.7-rc2-mm1: e1000_ethtool.c compile error Adrian Bunk
2004-06-01 19:09 ` 2.6.7-rc2-mm1 Dominik Karall
2004-06-01 19:47   ` 2.6.7-rc2-mm1 Luiz Fernando N. Capitulino
2004-06-01 21:06     ` 2.6.7-rc2-mm1 Dominik Karall
2004-06-01 19:35 ` 2.6.7-rc2-mm1: compile error in kernel/exit.c Peter Lundkvist
2004-06-01 21:24   ` Mikael Pettersson
2004-06-01 23:12 ` 2.6.7-rc2-mm1 (compile stats) John Cherry
2004-06-02  0:39 ` [patch] 2.6.7-rc2-mm1: let SERIAL_8250_ACPI depend on ACPI_PCI Adrian Bunk
2004-06-02 11:27   ` [ACPI] " Matthew Wilcox
2004-06-02 16:51   ` Bjorn Helgaas
2004-06-02  1:24 ` William Lee Irwin III [this message]
2004-06-02  1:26   ` [2/2] fix io_getevents() timer expiry setting William Lee Irwin III
2004-06-02 18:43   ` [1/2] use const in time.h unit conversion functions Matt Mackall
2004-06-02 18:52     ` William Lee Irwin III
2004-06-03  8:17       ` Denis Vlasenko
2004-06-02  9:21 ` 2.6.7-rc2-mm1 - bk-netdev.patch e1000_ethtool.c doesn't build Paul Jackson
2004-06-02  9:41   ` Paul Jackson
2004-06-02 13:26 ` 2.6.7-rc2-mm1 William Lee Irwin III
2004-06-03 23:38   ` 2.6.7-rc2-mm1 Greg KH
2004-06-04  0:07     ` 2.6.7-rc2-mm1 William Lee Irwin III
2004-06-04  5:18       ` 2.6.7-rc2-mm1 Vojtech Pavlik
2004-06-03  0:51 ` 2.6.7-rc2-mm1 Joshua Kwan
2004-06-03 13:24   ` 2.6.7-rc2-mm1 Mikael Pettersson

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=20040602012429.GV2093@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=akpm@osdl.org \
    --cc=linux-aio@kvack.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suparna@in.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