summaryrefslogtreecommitdiff
path: root/src/mem/dram_ctrl.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2015-11-06 03:26:16 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2015-11-06 03:26:16 -0500
commit2cb5467e8514934c4d88304c65050adead0ffc7e (patch)
tree693dc8a9aa6fdadb2d1856bece4510e30527c256 /src/mem/dram_ctrl.cc
parent3747e178ed11ef0d73a50443bc9dc5498a91b1c9 (diff)
downloadgem5-2cb5467e8514934c4d88304c65050adead0ffc7e.tar.xz
misc: Appease clang static analyzer
A few minor fixes to issues identified by the clang static analyzer.
Diffstat (limited to 'src/mem/dram_ctrl.cc')
-rw-r--r--src/mem/dram_ctrl.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/mem/dram_ctrl.cc b/src/mem/dram_ctrl.cc
index dc2c03332..3ba4616f7 100644
--- a/src/mem/dram_ctrl.cc
+++ b/src/mem/dram_ctrl.cc
@@ -341,9 +341,8 @@ DRAMCtrl::decodeAddr(PacketPtr pkt, Addr dramPktAddr, unsigned size,
rank = addr % ranksPerChannel;
addr = addr / ranksPerChannel;
- // lastly, get the row bits
+ // lastly, get the row bits, no need to remove them from addr
row = addr % rowsPerBank;
- addr = addr / rowsPerBank;
} else if (addrMapping == Enums::RoRaBaCoCh) {
// take out the lower-order column bits
addr = addr / columnsPerStripe;
@@ -364,9 +363,8 @@ DRAMCtrl::decodeAddr(PacketPtr pkt, Addr dramPktAddr, unsigned size,
rank = addr % ranksPerChannel;
addr = addr / ranksPerChannel;
- // lastly, get the row bits
+ // lastly, get the row bits, no need to remove them from addr
row = addr % rowsPerBank;
- addr = addr / rowsPerBank;
} else if (addrMapping == Enums::RoCoRaBaCh) {
// optimise for closed page mode and utilise maximum
// parallelism of the DRAM (at the cost of power)
@@ -391,9 +389,8 @@ DRAMCtrl::decodeAddr(PacketPtr pkt, Addr dramPktAddr, unsigned size,
// next, the higher-order column bites
addr = addr / (columnsPerRowBuffer / columnsPerStripe);
- // lastly, get the row bits
+ // lastly, get the row bits, no need to remove them from addr
row = addr % rowsPerBank;
- addr = addr / rowsPerBank;
} else
panic("Unknown address mapping policy chosen!");