From 61bc18a3276d40a71039a2790ac33b9c320e8234 Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Sat, 20 Aug 2011 19:21:46 +0000 Subject: [PATCH] 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) --- sys/amd64/amd64/machdep.c | 5 ++--- sys/i386/i386/machdep.c | 5 ++--- sys/pc98/pc98/machdep.c | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 00aa47247b08..1e7b26c081f4 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -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 diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 73e755137684..e596b964d992 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -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 @@ 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)) diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index 22131a625b8f..b42249caea99 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -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))