svn commit: r225048 - in head/sys: amd64/amd64 i386/i386 pc98/pc98

Bjoern A. Zeeb bz at FreeBSD.org
Sat Aug 20 19:21:47 UTC 2011


Author: bz
Date: Sat Aug 20 19:21:46 2011
New Revision: 225048
URL: http://svn.freebsd.org/changeset/base/225048

Log:
  In HEAD 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.
  
  Reported by:	jhb, bde
  MFC after:	3 days
  X-MFC with:	r224516
  Approved by:	re (kib)

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/i386/i386/machdep.c
  head/sys/pc98/pc98/machdep.c

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Sat Aug 20 19:09:25 2011	(r225047)
+++ head/sys/amd64/amd64/machdep.c	Sat Aug 20 19:21:46 2011	(r225048)
@@ -1309,7 +1309,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;
@@ -1376,8 +1376,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: head/sys/i386/i386/machdep.c
==============================================================================
--- head/sys/i386/i386/machdep.c	Sat Aug 20 19:09:25 2011	(r225047)
+++ head/sys/i386/i386/machdep.c	Sat Aug 20 19:21:46 2011	(r225048)
@@ -2132,7 +2132,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;
@@ -2344,8 +2344,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: head/sys/pc98/pc98/machdep.c
==============================================================================
--- head/sys/pc98/pc98/machdep.c	Sat Aug 20 19:09:25 2011	(r225047)
+++ head/sys/pc98/pc98/machdep.c	Sat Aug 20 19:21:46 2011	(r225048)
@@ -1855,7 +1855,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;
@@ -1920,8 +1920,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))


More information about the svn-src-all mailing list