Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jul 2011 19:03:50 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r224389 - stable/7/sys/sparc64/sparc64
Message-ID:  <201107251903.p6PJ3oNg072637@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Mon Jul 25 19:03:50 2011
New Revision: 224389
URL: http://svn.freebsd.org/changeset/base/224389

Log:
  MFC: r223961
  
  - 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:
  stable/7/sys/sparc64/sparc64/counter.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/sparc64/counter.c
==============================================================================
--- stable/7/sys/sparc64/sparc64/counter.c	Mon Jul 25 19:03:45 2011	(r224388)
+++ stable/7/sys/sparc64/sparc64/counter.c	Mon Jul 25 19:03:50 2011	(r224389)
@@ -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));
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107251903.p6PJ3oNg072637>