summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-03-19 11:34:23 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-03-19 11:34:23 +0000
commitcde54d41d41ecc698408ab4c1f6c1ed3bdcd939e (patch)
treed9413614165f0ac9fd7494467fa1480622305bc0 /sys/dev
parentaead540ed22f539ba3dbfa37327af5dd4c8fe578 (diff)
Reduces the noise around the global ``ticks'' variable by renaming
all the local ones to ``nticks''. ok stefan@, deraadt@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/aic79xx_openbsd.c22
-rw-r--r--sys/dev/ic/re.c8
-rw-r--r--sys/dev/isa/spkr.c18
-rw-r--r--sys/dev/pci/ichwdt.c12
-rw-r--r--sys/dev/sbus/stp4020.c16
-rw-r--r--sys/dev/usb/uthum.c16
6 files changed, 46 insertions, 46 deletions
diff --git a/sys/dev/ic/aic79xx_openbsd.c b/sys/dev/ic/aic79xx_openbsd.c
index ee636eb146f..c396b30fdff 100644
--- a/sys/dev/ic/aic79xx_openbsd.c
+++ b/sys/dev/ic/aic79xx_openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic79xx_openbsd.c,v 1.43 2015/07/17 21:42:49 krw Exp $ */
+/* $OpenBSD: aic79xx_openbsd.c,v 1.44 2016/03/19 11:34:22 mpi Exp $ */
/*
* Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom
@@ -692,24 +692,24 @@ void
aic_timer_reset(aic_timer_t *timer, u_int msec, ahd_callback_t *func,
void *arg)
{
- uint64_t ticks;
+ uint64_t nticks;
- ticks = msec;
- ticks *= hz;
- ticks /= 1000;
- callout_reset(timer, ticks, func, arg);
+ nticks = msec;
+ nticks *= hz;
+ nticks /= 1000;
+ callout_reset(timer, nticks, func, arg);
}
void
aic_scb_timer_reset(struct scb *scb, u_int msec)
{
- uint64_t ticks;
+ uint64_t nticks;
- ticks = msec;
- ticks *= hz;
- ticks /= 1000;
+ nticks = msec;
+ nticks *= hz;
+ nticks /= 1000;
if (!(scb->xs->xs_control & XS_CTL_POLL))
- callout_reset(&scb->xs->xs_callout, ticks, ahd_timeout, scb);
+ callout_reset(&scb->xs->xs_callout, nticks, ahd_timeout, scb);
}
void
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c
index f8f77a59244..6330e4432fb 100644
--- a/sys/dev/ic/re.c
+++ b/sys/dev/ic/re.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: re.c,v 1.189 2016/01/04 05:41:22 dlg Exp $ */
+/* $OpenBSD: re.c,v 1.190 2016/03/19 11:34:22 mpi Exp $ */
/* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@@ -2262,15 +2262,15 @@ re_setup_sim_im(struct rl_softc *sc)
if (sc->sc_hwrev == RL_HWREV_8139CPLUS)
CSR_WRITE_4(sc, RL_TIMERINT, 0x400); /* XXX */
else {
- u_int32_t ticks;
+ u_int32_t nticks;
/*
* Datasheet says tick decreases at bus speed,
* but it seems the clock runs a little bit
* faster, so we do some compensation here.
*/
- ticks = (sc->rl_sim_time * sc->rl_bus_speed * 8) / 5;
- CSR_WRITE_4(sc, RL_TIMERINT_8169, ticks);
+ nticks = (sc->rl_sim_time * sc->rl_bus_speed * 8) / 5;
+ CSR_WRITE_4(sc, RL_TIMERINT_8169, nticks);
}
CSR_WRITE_4(sc, RL_TIMERCNT, 1); /* reload */
sc->rl_timerintr = 1;
diff --git a/sys/dev/isa/spkr.c b/sys/dev/isa/spkr.c
index d8a54c45425..26cc2434802 100644
--- a/sys/dev/isa/spkr.c
+++ b/sys/dev/isa/spkr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spkr.c,v 1.20 2015/11/25 04:49:10 tedu Exp $ */
+/* $OpenBSD: spkr.c,v 1.21 2016/03/19 11:34:22 mpi Exp $ */
/* $NetBSD: spkr.c,v 1.1 1998/04/15 20:26:18 drochner Exp $ */
/*
@@ -83,16 +83,16 @@ static void playstring(char *, size_t);
/* emit tone of frequency hz for given number of ticks */
static void
-tone(hz, ticks)
- u_int hz, ticks;
+tone(hz, nticks)
+ u_int hz, nticks;
{
- pcppi_bell(ppicookie, hz, ticks, PCPPI_BELL_SLEEP);
+ pcppi_bell(ppicookie, hz, nticks, PCPPI_BELL_SLEEP);
}
/* rest for given number of ticks */
static void
-rest(ticks)
- int ticks;
+rest(nticks)
+ int nticks;
{
/*
* Set timeout to endrest function, then give up the timeslice.
@@ -100,10 +100,10 @@ rest(ticks)
* waited out.
*/
#ifdef SPKRDEBUG
- printf("rest: %d\n", ticks);
+ printf("rest: %d\n", nticks);
#endif /* SPKRDEBUG */
- if (ticks > 0)
- tsleep(rest, SPKRPRI | PCATCH, "rest", ticks);
+ if (nticks > 0)
+ tsleep(rest, SPKRPRI | PCATCH, "rest", nticks);
}
/**************** PLAY STRING INTERPRETER BEGINS HERE **********************
diff --git a/sys/dev/pci/ichwdt.c b/sys/dev/pci/ichwdt.c
index ef03dc979ba..a87b6844708 100644
--- a/sys/dev/pci/ichwdt.c
+++ b/sys/dev/pci/ichwdt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ichwdt.c,v 1.5 2014/12/10 12:27:57 mikeb Exp $ */
+/* $OpenBSD: ichwdt.c,v 1.6 2016/03/19 11:34:22 mpi Exp $ */
/*
* Copyright (c) 2004, 2005 Alexander Yurchenko <grange@openbsd.org>
@@ -158,7 +158,7 @@ int
ichwdt_cb(void *arg, int period)
{
struct ichwdt_softc *sc = arg;
- int ticks;
+ int nticks;
if (period == 0) {
if (sc->sc_period != 0) {
@@ -178,11 +178,11 @@ ichwdt_cb(void *arg, int period)
if (sc->sc_period != period) {
/* Set new timeout */
- ticks = (period * 33000000) / sc->sc_divisor;
- ichwdt_unlock_write(sc, ICH_WDT_PRE1, ticks);
+ nticks = (period * 33000000) / sc->sc_divisor;
+ ichwdt_unlock_write(sc, ICH_WDT_PRE1, nticks);
ichwdt_unlock_write(sc, ICH_WDT_PRE2, 2);
- DPRINTF(("%s: timeout %ds (%d ticks)\n",
- sc->sc_dev.dv_xname, period, ticks));
+ DPRINTF(("%s: timeout %ds (%d nticks)\n",
+ sc->sc_dev.dv_xname, period, nticks));
}
if (sc->sc_period == 0) {
/* Enable watchdog */
diff --git a/sys/dev/sbus/stp4020.c b/sys/dev/sbus/stp4020.c
index cde691ef8d9..1fd19684546 100644
--- a/sys/dev/sbus/stp4020.c
+++ b/sys/dev/sbus/stp4020.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: stp4020.c,v 1.18 2013/11/19 01:23:51 deraadt Exp $ */
+/* $OpenBSD: stp4020.c,v 1.19 2016/03/19 11:34:22 mpi Exp $ */
/* $NetBSD: stp4020.c,v 1.23 2002/06/01 23:51:03 lukem Exp $ */
/*-
@@ -898,21 +898,21 @@ void
stp4020_delay(ms)
unsigned int ms;
{
- unsigned int ticks;
+ unsigned int nticks;
- /* Convert to ticks */
- ticks = (ms * hz) / 1000000;
+ /* Convert to nticks */
+ nticks = (ms * hz) / 1000000;
- if (cold || ticks == 0) {
+ if (cold || nticks == 0) {
delay(ms);
return;
}
#ifdef DEBUG
- if (ticks > 60 * hz)
- panic("stp4020: preposterous delay: %u", ticks);
+ if (nticks > 60 * hz)
+ panic("stp4020: preposterous delay: %u", nticks);
#endif
- tsleep(&ticks, 0, "stp4020_delay", ticks);
+ tsleep(&nticks, 0, "stp4020_delay", nticks);
}
#ifdef STP4020_DEBUG
diff --git a/sys/dev/usb/uthum.c b/sys/dev/usb/uthum.c
index b8c65754bb2..56f3695e84f 100644
--- a/sys/dev/usb/uthum.c
+++ b/sys/dev/usb/uthum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthum.c,v 1.30 2016/01/09 04:14:42 jcs Exp $ */
+/* $OpenBSD: uthum.c,v 1.31 2016/03/19 11:34:22 mpi Exp $ */
/*
* Copyright (c) 2009, 2010 Yojiro UO <yuo@nui.org>
@@ -742,7 +742,7 @@ uthum_ds75_temp(uint8_t msb, uint8_t lsb)
int
uthum_sht1x_temp(uint8_t msb, uint8_t lsb)
{
- int ticks;
+ int nticks;
/* sensor device VDD-bias value table
* ----------------------------------------------
@@ -754,20 +754,20 @@ uthum_sht1x_temp(uint8_t msb, uint8_t lsb)
* bias -3970 will be best for that device.
*/
- ticks = (msb * 256 + lsb) & 0x3fff;
- return (ticks - 3970);
+ nticks = (msb * 256 + lsb) & 0x3fff;
+ return (nticks - 3970);
}
/* return %RH * 1000 */
int
uthum_sht1x_rh(uint8_t msb, uint8_t lsb, int temp)
{
- int ticks, rh_l;
+ int nticks, rh_l;
- ticks = (msb * 256 + lsb) & 0x0fff;
- rh_l = (-40000 + 405 * ticks) - ((7 * ticks * ticks) / 250);
+ nticks = (msb * 256 + lsb) & 0x0fff;
+ rh_l = (-40000 + 405 * nticks) - ((7 * nticks * nticks) / 250);
- return ((temp - 2500) * (1 + (ticks >> 7)) + rh_l) / 10;
+ return ((temp - 2500) * (1 + (nticks >> 7)) + rh_l) / 10;
}
/* return muK */