* [PATCH] dma-debug: Delete outdated comment of the hash function
@ 2020-12-29 13:40 Zenghui Yu
0 siblings, 0 replies; only message in thread
From: Zenghui Yu @ 2020-12-29 13:40 UTC (permalink / raw)
To: linux-kernel, iommu, hch, m.szyprowski, robin.murphy
Cc: wanghaibin.wang, Zenghui Yu
We actually use dev_addr[26:13] as the index into dma_entry_hash. Given
that the code itself is clear enough, let's drop the hardcoded comment so
that we won't need to revisit it every time HASH_FN_{SHIFT,MASK} gets
updated.
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
---
kernel/dma/debug.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c
index 14de1271463f..d89341162d35 100644
--- a/kernel/dma/debug.c
+++ b/kernel/dma/debug.c
@@ -235,10 +235,7 @@ static bool driver_filter(struct device *dev)
*/
static int hash_fn(struct dma_debug_entry *entry)
{
- /*
- * Hash function is based on the dma address.
- * We use bits 20-27 here as the index into the hash
- */
+ /* Hash function is based on the dma address. */
return (entry->dev_addr >> HASH_FN_SHIFT) & HASH_FN_MASK;
}
--
2.19.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-12-29 13:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-29 13:40 [PATCH] dma-debug: Delete outdated comment of the hash function Zenghui Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).