142,143c142
< bool keep_trying = false;
< do {
---
> while (!pf.empty()) {
147,152c146
< if (keep_trying) {
< DPRINTF(HWPrefetch, "addr 0x%x in cache, skipping\n",
< pkt->getAddr());
< delete pkt->req;
< delete pkt;
< }
---
> Addr blk_addr = pkt->getAddr() & ~(Addr)(blkSize-1);
153a148,155
> if (!inCache(blk_addr) && !inMissQueue(blk_addr))
> // we found a prefetch, return it
> break;
>
> DPRINTF(HWPrefetch, "addr 0x%x in cache, skipping\n", pkt->getAddr());
> delete pkt->req;
> delete pkt;
>
156,158c158
< if (keep_trying) {
< return NULL; // None left, all were in cache
< }
---
> return NULL; // None left, all were in cache
160c160
< } while (keep_trying);
---
> }