misc: Appease clang static analyzer
A few minor fixes to issues identified by the clang static analyzer.
This commit is contained in:
parent
3747e178ed
commit
2cb5467e85
6 changed files with 13 additions and 18 deletions
|
@ -109,7 +109,10 @@ DtbObject::addBootCmdLine(const char* _args, size_t len)
|
||||||
// try adding the node by walking dtb tree to proper insertion point
|
// try adding the node by walking dtb tree to proper insertion point
|
||||||
offset = fdt_path_offset((void*)fdt_buf_w_space, root_path);
|
offset = fdt_path_offset((void*)fdt_buf_w_space, root_path);
|
||||||
offset = fdt_add_subnode((void*)fdt_buf_w_space, offset, node_name);
|
offset = fdt_add_subnode((void*)fdt_buf_w_space, offset, node_name);
|
||||||
offset = fdt_path_offset((void*)fdt_buf_w_space, full_path_node_name);
|
// if we successfully add the subnode, get the offset
|
||||||
|
if (offset >= 0)
|
||||||
|
offset = fdt_path_offset((void*)fdt_buf_w_space, full_path_node_name);
|
||||||
|
|
||||||
if (offset < 0) {
|
if (offset < 0) {
|
||||||
warn("Error finding or adding \"chosen\" subnode to flattened "
|
warn("Error finding or adding \"chosen\" subnode to flattened "
|
||||||
"device tree, errno: %d\n", offset);
|
"device tree, errno: %d\n", offset);
|
||||||
|
|
2
src/mem/cache/tags/fa_lru.cc
vendored
2
src/mem/cache/tags/fa_lru.cc
vendored
|
@ -67,7 +67,7 @@ FALRU::FALRU(const Params *p)
|
||||||
numCaches = floorLog2(size) - 17;
|
numCaches = floorLog2(size) - 17;
|
||||||
if (numCaches >0){
|
if (numCaches >0){
|
||||||
cacheBoundaries = new FALRUBlk *[numCaches];
|
cacheBoundaries = new FALRUBlk *[numCaches];
|
||||||
cacheMask = (1 << numCaches) - 1;
|
cacheMask = (ULL(1) << numCaches) - 1;
|
||||||
} else {
|
} else {
|
||||||
cacheMask = 0;
|
cacheMask = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -341,9 +341,8 @@ DRAMCtrl::decodeAddr(PacketPtr pkt, Addr dramPktAddr, unsigned size,
|
||||||
rank = addr % ranksPerChannel;
|
rank = addr % ranksPerChannel;
|
||||||
addr = 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;
|
row = addr % rowsPerBank;
|
||||||
addr = addr / rowsPerBank;
|
|
||||||
} else if (addrMapping == Enums::RoRaBaCoCh) {
|
} else if (addrMapping == Enums::RoRaBaCoCh) {
|
||||||
// take out the lower-order column bits
|
// take out the lower-order column bits
|
||||||
addr = addr / columnsPerStripe;
|
addr = addr / columnsPerStripe;
|
||||||
|
@ -364,9 +363,8 @@ DRAMCtrl::decodeAddr(PacketPtr pkt, Addr dramPktAddr, unsigned size,
|
||||||
rank = addr % ranksPerChannel;
|
rank = addr % ranksPerChannel;
|
||||||
addr = 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;
|
row = addr % rowsPerBank;
|
||||||
addr = addr / rowsPerBank;
|
|
||||||
} else if (addrMapping == Enums::RoCoRaBaCh) {
|
} else if (addrMapping == Enums::RoCoRaBaCh) {
|
||||||
// optimise for closed page mode and utilise maximum
|
// optimise for closed page mode and utilise maximum
|
||||||
// parallelism of the DRAM (at the cost of power)
|
// 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
|
// next, the higher-order column bites
|
||||||
addr = addr / (columnsPerRowBuffer / columnsPerStripe);
|
addr = addr / (columnsPerRowBuffer / columnsPerStripe);
|
||||||
|
|
||||||
// lastly, get the row bits
|
// lastly, get the row bits, no need to remove them from addr
|
||||||
row = addr % rowsPerBank;
|
row = addr % rowsPerBank;
|
||||||
addr = addr / rowsPerBank;
|
|
||||||
} else
|
} else
|
||||||
panic("Unknown address mapping policy chosen!");
|
panic("Unknown address mapping policy chosen!");
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ class NetworkInterface_d : public ClockedObject, public Consumer
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GarnetNetwork_d *m_net_ptr;
|
GarnetNetwork_d *m_net_ptr;
|
||||||
const NodeID m_id;
|
const NodeID M5_CLASS_VAR_USED m_id;
|
||||||
const int m_virtual_networks, m_vc_per_vnet, m_num_vcs;
|
const int m_virtual_networks, m_vc_per_vnet, m_num_vcs;
|
||||||
std::vector<OutVcState_d *> m_out_vc_state;
|
std::vector<OutVcState_d *> m_out_vc_state;
|
||||||
std::vector<int> m_vc_allocator;
|
std::vector<int> m_vc_allocator;
|
||||||
|
|
|
@ -370,7 +370,7 @@ RubySystem::startup()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore eventq head
|
// Restore eventq head
|
||||||
eventq_head = eventq->replaceHead(eventq_head);
|
eventq->replaceHead(eventq_head);
|
||||||
// Restore curTick and Ruby System's clock
|
// Restore curTick and Ruby System's clock
|
||||||
setCurTick(curtick_original);
|
setCurTick(curtick_original);
|
||||||
resetClock();
|
resetClock();
|
||||||
|
|
|
@ -359,8 +359,6 @@ std::pair< uint64_t, bool>
|
||||||
StackDistCalc::calcStackDistAndUpdate(const Addr r_address, bool addNewNode)
|
StackDistCalc::calcStackDistAndUpdate(const Addr r_address, bool addNewNode)
|
||||||
{
|
{
|
||||||
Node* newLeafNode;
|
Node* newLeafNode;
|
||||||
// Return index if the address was already present in stack
|
|
||||||
uint64_t r_index = index;
|
|
||||||
|
|
||||||
auto ai = aiMap.lower_bound(r_address);
|
auto ai = aiMap.lower_bound(r_address);
|
||||||
|
|
||||||
|
@ -380,7 +378,7 @@ StackDistCalc::calcStackDistAndUpdate(const Addr r_address, bool addNewNode)
|
||||||
// key already exists
|
// key already exists
|
||||||
// save the index counter value when this address was
|
// save the index counter value when this address was
|
||||||
// encountered before and update it to the current index value
|
// encountered before and update it to the current index value
|
||||||
r_index = ai->second;
|
uint64_t r_index = ai->second;
|
||||||
|
|
||||||
if (addNewNode) {
|
if (addNewNode) {
|
||||||
// Update aiMap aiMap(Address) = current index
|
// Update aiMap aiMap(Address) = current index
|
||||||
|
@ -462,8 +460,6 @@ StackDistCalc::calcStackDistAndUpdate(const Addr r_address, bool addNewNode)
|
||||||
std::pair< uint64_t, bool>
|
std::pair< uint64_t, bool>
|
||||||
StackDistCalc::calcStackDist(const Addr r_address, bool mark)
|
StackDistCalc::calcStackDist(const Addr r_address, bool mark)
|
||||||
{
|
{
|
||||||
// Return index if the address was already present in stack
|
|
||||||
uint64_t r_index = index;
|
|
||||||
// Default value of isMarked flag for each node.
|
// Default value of isMarked flag for each node.
|
||||||
bool _mark = false;
|
bool _mark = false;
|
||||||
|
|
||||||
|
@ -480,7 +476,7 @@ StackDistCalc::calcStackDist(const Addr r_address, bool mark)
|
||||||
// key already exists
|
// key already exists
|
||||||
// save the index counter value when this address was
|
// save the index counter value when this address was
|
||||||
// encountered before
|
// encountered before
|
||||||
r_index = ai->second;
|
uint64_t r_index = ai->second;
|
||||||
|
|
||||||
// Get the value of mark flag if previously marked
|
// Get the value of mark flag if previously marked
|
||||||
_mark = tree[0][r_index]->isMarked;
|
_mark = tree[0][r_index]->isMarked;
|
||||||
|
@ -569,7 +565,6 @@ void
|
||||||
StackDistCalc::printStack(int n) const
|
StackDistCalc::printStack(int n) const
|
||||||
{
|
{
|
||||||
Node* node;
|
Node* node;
|
||||||
uint64_t r_index;
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
DPRINTF(StackDist, "Printing last %d entries in tree\n", n);
|
DPRINTF(StackDist, "Printing last %d entries in tree\n", n);
|
||||||
|
@ -578,7 +573,7 @@ StackDistCalc::printStack(int n) const
|
||||||
for (auto it = tree[0].rbegin(); (count < n) && (it != tree[0].rend());
|
for (auto it = tree[0].rbegin(); (count < n) && (it != tree[0].rend());
|
||||||
++it, ++count) {
|
++it, ++count) {
|
||||||
node = it->second;
|
node = it->second;
|
||||||
r_index = node->nodeIndex;
|
uint64_t r_index = node->nodeIndex;
|
||||||
|
|
||||||
// Lookup aiMap using the index returned by the leaf iterator
|
// Lookup aiMap using the index returned by the leaf iterator
|
||||||
for (auto ai = aiMap.rbegin(); ai != aiMap.rend(); ++ai) {
|
for (auto ai = aiMap.rbegin(); ai != aiMap.rend(); ++ai) {
|
||||||
|
|
Loading…
Reference in a new issue