aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac
diff options
context:
space:
mode:
authorBorislav Petkov <borislav.petkov@amd.com>2012-08-10 06:50:50 -0400
committerBorislav Petkov <bp@alien8.de>2012-11-28 05:44:12 -0500
commit1f31677e0d5492ce8776a39c9dcda4a0d75c7da1 (patch)
tree64a1fdf90abdb0782ddd43c9c9c8f30b8b1b4e92 /drivers/edac
parentf430d5707aa47af8669bbc0083a79e7d780908b2 (diff)
amd64_edac: Small fixlets and cleanups
amd64_get_dram_hole_info: remove local variable 'base'. sys_addr_to_dram_addr: do not clear local variable 'ret'. Also, sanitize constants formatting. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r--drivers/edac/amd64_edac.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index cc8e7c78a23c..5960a8a07fd2 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -423,7 +423,6 @@ int amd64_get_dram_hole_info(struct mem_ctl_info *mci, u64 *hole_base,
423 u64 *hole_offset, u64 *hole_size) 423 u64 *hole_offset, u64 *hole_size)
424{ 424{
425 struct amd64_pvt *pvt = mci->pvt_info; 425 struct amd64_pvt *pvt = mci->pvt_info;
426 u64 base;
427 426
428 /* only revE and later have the DRAM Hole Address Register */ 427 /* only revE and later have the DRAM Hole Address Register */
429 if (boot_cpu_data.x86 == 0xf && pvt->ext_model < K8_REV_E) { 428 if (boot_cpu_data.x86 == 0xf && pvt->ext_model < K8_REV_E) {
@@ -462,10 +461,8 @@ int amd64_get_dram_hole_info(struct mem_ctl_info *mci, u64 *hole_base,
462 * addresses in the hole so that they start at 0x100000000. 461 * addresses in the hole so that they start at 0x100000000.
463 */ 462 */
464 463
465 base = dhar_base(pvt); 464 *hole_base = dhar_base(pvt);
466 465 *hole_size = (1ULL << 32) - *hole_base;
467 *hole_base = base;
468 *hole_size = (0x1ull << 32) - base;
469 466
470 if (boot_cpu_data.x86 > 0xf) 467 if (boot_cpu_data.x86 > 0xf)
471 *hole_offset = f10_dhar_offset(pvt); 468 *hole_offset = f10_dhar_offset(pvt);
@@ -513,15 +510,15 @@ static u64 sys_addr_to_dram_addr(struct mem_ctl_info *mci, u64 sys_addr)
513{ 510{
514 struct amd64_pvt *pvt = mci->pvt_info; 511 struct amd64_pvt *pvt = mci->pvt_info;
515 u64 dram_base, hole_base, hole_offset, hole_size, dram_addr; 512 u64 dram_base, hole_base, hole_offset, hole_size, dram_addr;
516 int ret = 0; 513 int ret;
517 514
518 dram_base = get_dram_base(pvt, pvt->mc_node_id); 515 dram_base = get_dram_base(pvt, pvt->mc_node_id);
519 516
520 ret = amd64_get_dram_hole_info(mci, &hole_base, &hole_offset, 517 ret = amd64_get_dram_hole_info(mci, &hole_base, &hole_offset,
521 &hole_size); 518 &hole_size);
522 if (!ret) { 519 if (!ret) {
523 if ((sys_addr >= (1ull << 32)) && 520 if ((sys_addr >= (1ULL << 32)) &&
524 (sys_addr < ((1ull << 32) + hole_size))) { 521 (sys_addr < ((1ULL << 32) + hole_size))) {
525 /* use DHAR to translate SysAddr to DramAddr */ 522 /* use DHAR to translate SysAddr to DramAddr */
526 dram_addr = sys_addr - hole_offset; 523 dram_addr = sys_addr - hole_offset;
527 524