From owner-svn-src-stable-8@FreeBSD.ORG Mon Jul 25 19:03:45 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3139106566C; Mon, 25 Jul 2011 19:03:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C24E48FC12; Mon, 25 Jul 2011 19:03:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJ3jMH072603; Mon, 25 Jul 2011 19:03:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ3jNX072601; Mon, 25 Jul 2011 19:03:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251903.p6PJ3jNX072601@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224388 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:03:45 -0000 Author: marius Date: Mon Jul 25 19:03:45 2011 New Revision: 224388 URL: http://svn.freebsd.org/changeset/base/224388 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/8/sys/sparc64/sparc64/counter.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/counter.c ============================================================================== --- stable/8/sys/sparc64/sparc64/counter.c Mon Jul 25 19:01:36 2011 (r224387) +++ stable/8/sys/sparc64/sparc64/counter.c Mon Jul 25 19:03:45 2011 (r224388) @@ -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)); }