diff options
author | marius <marius@FreeBSD.org> | 2011-07-12 18:02:37 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2011-07-12 18:02:37 +0000 |
commit | 105be4437ce98749089013aff9edeabbd1169b78 (patch) | |
tree | 0600043aa822bc9fe80b39d17a09834a27482568 | |
parent | 263e8197220c6aae96d3f85a5ca35a1e0bb4bbcd (diff) | |
download | FreeBSD-src-105be4437ce98749089013aff9edeabbd1169b78.zip FreeBSD-src-105be4437ce98749089013aff9edeabbd1169b78.tar.gz |
- Remove redundant timecounter masking from counter_get_timecount().
- Zero the timecounter when allocation so we don't need to initialize unused
members and remove a now redundant NULL assignment.
Submitted by: jkim
-rw-r--r-- | sys/sparc64/sparc64/counter.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/sparc64/sparc64/counter.c b/sys/sparc64/sparc64/counter.c index cb9241a..8009fad 100644 --- a/sys/sparc64/sparc64/counter.c +++ b/sys/sparc64/sparc64/counter.c @@ -86,13 +86,12 @@ sparc64_counter_init(const char *name, bus_space_tag_t tag, bus_space_write_8(tag, handle, offset + CTR_CT1 + CTR_LIMIT, COUNTER_MASK); /* Register as a time counter. */ - tc = malloc(sizeof(*tc), M_DEVBUF, M_WAITOK); + tc = malloc(sizeof(*tc), M_DEVBUF, M_WAITOK | M_ZERO); sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK); sc->sc_tag = tag; sc->sc_handle = handle; sc->sc_offset = offset + CTR_CT0; tc->tc_get_timecount = counter_get_timecount; - tc->tc_poll_pps = NULL; tc->tc_counter_mask = COUNTER_MASK; tc->tc_frequency = COUNTER_FREQ; tc->tc_name = strdup(name, M_DEVBUF); @@ -107,6 +106,5 @@ counter_get_timecount(struct timecounter *tc) struct ct_softc *sc; sc = tc->tc_priv; - return (bus_space_read_8(sc->sc_tag, sc->sc_handle, sc->sc_offset) & - COUNTER_MASK); + return (bus_space_read_8(sc->sc_tag, sc->sc_handle, sc->sc_offset)); } |