summaryrefslogtreecommitdiff
path: root/usr/src/uts/common
diff options
context:
space:
mode:
authorJosef 'Jeff' Sipek <josef.sipek@nexenta.com>2014-04-29 13:05:25 -0400
committerRichard Lowe <richlowe@richlowe.net>2014-04-29 19:58:01 -0400
commit19449258028e6813f0b7a606b554b2fa37a390ec (patch)
treeefea614096aaea148d4996ef59fd97c6dbf0d687 /usr/src/uts/common
parentcb3e7fb42f8104f779abb6856ccf6e5b8e6419d8 (diff)
downloadillumos-joyent-19449258028e6813f0b7a606b554b2fa37a390ec.tar.gz
4823 don't open-code NSEC2MSEC and MSEC2NSEC
Reviewed by: Richard Elling <richard.elling@gmail.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/uts/common')
-rw-r--r--usr/src/uts/common/dtrace/dtrace.c2
-rw-r--r--usr/src/uts/common/inet/ip/ip.c8
-rw-r--r--usr/src/uts/common/io/devpoll.c2
-rw-r--r--usr/src/uts/common/io/power.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/usr/src/uts/common/dtrace/dtrace.c b/usr/src/uts/common/dtrace/dtrace.c
index b9c5c1ddc7..00fbc0a0dd 100644
--- a/usr/src/uts/common/dtrace/dtrace.c
+++ b/usr/src/uts/common/dtrace/dtrace.c
@@ -139,7 +139,7 @@ dtrace_optval_t dtrace_ustackframes_default = 20;
dtrace_optval_t dtrace_jstackframes_default = 50;
dtrace_optval_t dtrace_jstackstrsize_default = 512;
int dtrace_msgdsize_max = 128;
-hrtime_t dtrace_chill_max = 500 * (NANOSEC / MILLISEC); /* 500 ms */
+hrtime_t dtrace_chill_max = MSEC2NSEC(500); /* 500 ms */
hrtime_t dtrace_chill_interval = NANOSEC; /* 1000 ms */
int dtrace_devdepth_max = 32;
int dtrace_err_verbose;
diff --git a/usr/src/uts/common/inet/ip/ip.c b/usr/src/uts/common/inet/ip/ip.c
index 313c6120ed..4b65ec8a6d 100644
--- a/usr/src/uts/common/inet/ip/ip.c
+++ b/usr/src/uts/common/inet/ip/ip.c
@@ -1498,7 +1498,7 @@ icmp_inbound_v4(mblk_t *mp, ip_recv_attr_t *ira)
/* Compute # of milliseconds since midnight */
gethrestime(&now);
ts = (now.tv_sec % (24 * 60 * 60)) * 1000 +
- now.tv_nsec / (NANOSEC / MILLISEC);
+ NSEC2MSEC(now.tv_nsec);
*tsp++ = htonl(ts); /* Lay in 'receive time' */
*tsp++ = htonl(ts); /* Lay in 'send time' */
BUMP_MIB(&ipst->ips_icmp_mib, icmpOutTimestampReps);
@@ -9117,7 +9117,7 @@ ip_forward_options(mblk_t *mp, ipha_t *ipha, ill_t *dst_ill,
/* Compute # of milliseconds since midnight */
gethrestime(&now);
ts = (now.tv_sec % (24 * 60 * 60)) * 1000 +
- now.tv_nsec / (NANOSEC / MILLISEC);
+ NSEC2MSEC(now.tv_nsec);
bcopy(&ts, (char *)opt + off, IPOPT_TS_TIMELEN);
opt[IPOPT_OFFSET] += IPOPT_TS_TIMELEN;
break;
@@ -9343,7 +9343,7 @@ ip_input_local_options(mblk_t *mp, ipha_t *ipha, ip_recv_attr_t *ira)
/* Compute # of milliseconds since midnight */
gethrestime(&now);
ts = (now.tv_sec % (24 * 60 * 60)) * 1000 +
- now.tv_nsec / (NANOSEC / MILLISEC);
+ NSEC2MSEC(now.tv_nsec);
bcopy(&ts, (char *)opt + off, IPOPT_TS_TIMELEN);
opt[IPOPT_OFFSET] += IPOPT_TS_TIMELEN;
break;
@@ -12025,7 +12025,7 @@ ip_output_local_options(ipha_t *ipha, ip_stack_t *ipst)
/* Compute # of milliseconds since midnight */
gethrestime(&now);
ts = (now.tv_sec % (24 * 60 * 60)) * 1000 +
- now.tv_nsec / (NANOSEC / MILLISEC);
+ NSEC2MSEC(now.tv_nsec);
bcopy(&ts, (char *)opt + off, IPOPT_TS_TIMELEN);
opt[IPOPT_OFFSET] += IPOPT_TS_TIMELEN;
break;
diff --git a/usr/src/uts/common/io/devpoll.c b/usr/src/uts/common/io/devpoll.c
index 7d311aaa10..a3fcbbba03 100644
--- a/usr/src/uts/common/io/devpoll.c
+++ b/usr/src/uts/common/io/devpoll.c
@@ -750,7 +750,7 @@ dpioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, int *rvalp)
* to absolute nanoseconds. They must wait for at
* least a tick.
*/
- deadline = deadline * NANOSEC / MILLISEC;
+ deadline = MSEC2NSEC(deadline);
deadline = MAX(deadline, nsec_per_tick);
deadline += now;
}
diff --git a/usr/src/uts/common/io/power.c b/usr/src/uts/common/io/power.c
index 61e675ba77..aed53f5334 100644
--- a/usr/src/uts/common/io/power.c
+++ b/usr/src/uts/common/io/power.c
@@ -116,7 +116,7 @@ static char hasEPIC = B_FALSE;
static void *power_state;
static int power_inst = -1;
-static hrtime_t power_button_debounce = NANOSEC/MILLISEC*10;
+static hrtime_t power_button_debounce = MSEC2NSEC(10);
static hrtime_t power_button_abort_interval = 1.5 * NANOSEC;
static int power_button_abort_presses = 3;
static int power_button_abort_enable = 1;