svn commit: r223961 - head/sys/sparc64/sparc64
Marius Strobl
marius at FreeBSD.org
Tue Jul 12 18:02:37 UTC 2011
Author: marius
Date: Tue Jul 12 18:02:37 2011
New Revision: 223961
URL: http://svn.freebsd.org/changeset/base/223961
Log:
- 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
Modified:
head/sys/sparc64/sparc64/counter.c
Modified: head/sys/sparc64/sparc64/counter.c
==============================================================================
--- head/sys/sparc64/sparc64/counter.c Tue Jul 12 17:56:42 2011 (r223960)
+++ head/sys/sparc64/sparc64/counter.c Tue Jul 12 18:02:37 2011 (r223961)
@@ -86,13 +86,12 @@ sparc64_counter_init(const char *name, b
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
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));
}
More information about the svn-src-all
mailing list