Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Jan 2012 22:08:58 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r230284 - in stable/8/sys: amd64/amd64 i386/i386 pc98/pc98
Message-ID:  <201201172208.q0HM8wnm009600@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Tue Jan 17 22:08:58 2012
New Revision: 230284
URL: http://svn.freebsd.org/changeset/base/230284

Log:
  MFC r225048:
  
   In this branch when doing no further checkes there is no reason use
   the temporary variable and check with if as TUNABLE_*_FETCH do not
   alter values unless successfully found the tunable.

Modified:
  stable/8/sys/amd64/amd64/machdep.c
  stable/8/sys/i386/i386/machdep.c
  stable/8/sys/pc98/pc98/machdep.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/amd64/amd64/machdep.c
==============================================================================
--- stable/8/sys/amd64/amd64/machdep.c	Tue Jan 17 22:02:30 2012	(r230283)
+++ stable/8/sys/amd64/amd64/machdep.c	Tue Jan 17 22:08:58 2012	(r230284)
@@ -1288,7 +1288,7 @@ getmemsize(caddr_t kmdp, u_int64_t first
 {
 	int i, physmap_idx, pa_indx, da_indx;
 	vm_paddr_t pa, physmap[PHYSMAP_SIZE];
-	u_long physmem_tunable, memtest, tmpul;
+	u_long physmem_tunable, memtest;
 	pt_entry_t *pte;
 	struct bios_smap *smapbase, *smap, *smapend;
 	u_int32_t smapsize;
@@ -1355,8 +1355,7 @@ getmemsize(caddr_t kmdp, u_int64_t first
 	 * one could eventually do more with the code than just disable it.
 	 */
 	memtest = 1;
-	if (TUNABLE_ULONG_FETCH("hw.memtest.tests", &tmpul))
-		memtest = tmpul;
+	TUNABLE_ULONG_FETCH("hw.memtest.tests", &memtest);
 
 	/*
 	 * Don't allow MAXMEM or hw.physmem to extend the amount of memory

Modified: stable/8/sys/i386/i386/machdep.c
==============================================================================
--- stable/8/sys/i386/i386/machdep.c	Tue Jan 17 22:02:30 2012	(r230283)
+++ stable/8/sys/i386/i386/machdep.c	Tue Jan 17 22:08:58 2012	(r230284)
@@ -2094,7 +2094,7 @@ static void
 getmemsize(int first)
 {
 	int has_smap, off, physmap_idx, pa_indx, da_indx;
-	u_long physmem_tunable, memtest, tmpul;
+	u_long physmem_tunable, memtest;
 	vm_paddr_t physmap[PHYSMAP_SIZE];
 	pt_entry_t *pte;
 	quad_t dcons_addr, dcons_size;
@@ -2306,8 +2306,7 @@ physmap_done:
 	 * one could eventually do more with the code than just disable it.
 	 */
 	memtest = 1;
-	if (TUNABLE_ULONG_FETCH("hw.memtest.tests", &tmpul))
-		memtest = tmpul;
+	TUNABLE_ULONG_FETCH("hw.memtest.tests", &memtest);
 
 	if (atop(physmap[physmap_idx + 1]) != Maxmem &&
 	    (boothowto & RB_VERBOSE))

Modified: stable/8/sys/pc98/pc98/machdep.c
==============================================================================
--- stable/8/sys/pc98/pc98/machdep.c	Tue Jan 17 22:02:30 2012	(r230283)
+++ stable/8/sys/pc98/pc98/machdep.c	Tue Jan 17 22:08:58 2012	(r230284)
@@ -1823,7 +1823,7 @@ static void
 getmemsize(int first)
 {
 	int off, physmap_idx, pa_indx, da_indx;
-	u_long physmem_tunable, memtest, tmpul;
+	u_long physmem_tunable, memtest;
 	vm_paddr_t physmap[PHYSMAP_SIZE];
 	pt_entry_t *pte;
 	quad_t dcons_addr, dcons_size;
@@ -1888,8 +1888,7 @@ getmemsize(int first)
 	 * one could eventually do more with the code than just disable it.
 	 */
 	memtest = 1;
-	if (TUNABLE_ULONG_FETCH("hw.memtest.tests", &tmpul))
-		memtest = tmpul;
+	TUNABLE_ULONG_FETCH("hw.memtest.tests", &memtest);
 
 	if (atop(physmap[physmap_idx + 1]) != Maxmem &&
 	    (boothowto & RB_VERBOSE))



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