diff options
author | bz <bz@FreeBSD.org> | 2011-08-20 19:21:46 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2011-08-20 19:21:46 +0000 |
commit | 422bc41b314b204b624a6825c4a751104981bcaa (patch) | |
tree | 124c9d626082caddc163e685307d7573478ee5a9 | |
parent | ff90e69a5ad57263f93dafbd3e5a5c47dc656a91 (diff) | |
download | FreeBSD-src-422bc41b314b204b624a6825c4a751104981bcaa.zip FreeBSD-src-422bc41b314b204b624a6825c4a751104981bcaa.tar.gz |
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)
-rw-r--r-- | sys/amd64/amd64/machdep.c | 5 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 5 | ||||
-rw-r--r-- | 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 00aa472..1e7b26c 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 73e7551..e596b96 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 @@ 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)) diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index 22131a6..b42249c 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)) |