From 131ae4a2eb42724f320da113532c47c580502fc0 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 24 Dec 2020 03:17:29 -0800 Subject: [PATCH] dev: Remove the return type from DmaPort::dmaAction. This function had a comment claiming that returning an arbitrary request from the call was necessary for page table walker statistics, but looking at the actual code, the return type was never used. Also returning whatever the last request happens to be seems arbitrary, and a bad boundary for modularization. The page table walker should not depend on the internal implementation of the DMA port. Change-Id: I00281fbaf6aeb85b15baf54f3d4a23ca1ac72b8b Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38716 Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg Tested-by: kokoro --- src/dev/dma_device.cc | 14 ++++---------- src/dev/dma_device.hh | 4 ++-- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/dev/dma_device.cc b/src/dev/dma_device.cc index 429773de4..da3583378 100644 --- a/src/dev/dma_device.cc +++ b/src/dev/dma_device.cc @@ -141,7 +141,7 @@ DmaPort::recvReqRetry() trySendTimingReq(); } -RequestPtr +void DmaPort::dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, uint8_t *data, uint32_t sid, uint32_t ssid, Tick delay, Request::Flags flag) @@ -151,10 +151,6 @@ DmaPort::dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, // i.e. cache line size DmaReqState *reqState = new DmaReqState(event, size, delay); - // (functionality added for Table Walker statistics) - // We're only interested in this when there will only be one request. - // For simplicity, we return the last request, which would also be - // the only request in that case. RequestPtr req = nullptr; DPRINTF(DMA, "Starting DMA for addr: %#x size: %d sched: %d\n", addr, size, @@ -186,16 +182,14 @@ DmaPort::dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, // just created, for atomic this involves actually completing all // the requests sendDma(); - - return req; } -RequestPtr +void DmaPort::dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, uint8_t *data, Tick delay, Request::Flags flag) { - return dmaAction(cmd, addr, size, event, data, - defaultSid, defaultSSid, delay, flag); + dmaAction(cmd, addr, size, event, data, + defaultSid, defaultSSid, delay, flag); } void diff --git a/src/dev/dma_device.hh b/src/dev/dma_device.hh index f61722394..00af98de8 100644 --- a/src/dev/dma_device.hh +++ b/src/dev/dma_device.hh @@ -150,11 +150,11 @@ class DmaPort : public RequestPort, public Drainable DmaPort(ClockedObject *dev, System *s, uint32_t sid=0, uint32_t ssid=0); - RequestPtr + void dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, uint8_t *data, Tick delay, Request::Flags flag=0); - RequestPtr + void dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, uint8_t *data, uint32_t sid, uint32_t ssid, Tick delay, Request::Flags flag=0); -- 2.30.2