Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jun 2022 04:03:41 GMT
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 32e82bcc1527 - main - busdma_iommu: Eliminate a redundant trunc_page()
Message-ID:  <202206210403.25L43fJd045435@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by alc:

URL: https://cgit.FreeBSD.org/src/commit/?id=32e82bcc152783dfe0d03ffdd864cedfddbc80d7

commit 32e82bcc152783dfe0d03ffdd864cedfddbc80d7
Author:     Alan Cox <alc@FreeBSD.org>
AuthorDate: 2022-06-20 18:40:42 +0000
Commit:     Alan Cox <alc@FreeBSD.org>
CommitDate: 2022-06-21 04:03:04 +0000

    busdma_iommu: Eliminate a redundant trunc_page()
    
    Since OFF_TO_IDX() inherently truncates the given value, there is no
    need to perform trunc_page() on it.
    
    MFC after:      2 weeks
---
 sys/dev/iommu/busdma_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/iommu/busdma_iommu.c b/sys/dev/iommu/busdma_iommu.c
index ae8c98922e41..42fc0b6c5451 100644
--- a/sys/dev/iommu/busdma_iommu.c
+++ b/sys/dev/iommu/busdma_iommu.c
@@ -634,7 +634,7 @@ iommu_bus_dmamap_load_something1(struct bus_dma_tag_iommu *tag,
 		segs[seg].ds_addr = entry->start + offset;
 		segs[seg].ds_len = buflen1;
 
-		idx += OFF_TO_IDX(trunc_page(offset + buflen1));
+		idx += OFF_TO_IDX(offset + buflen1);
 		offset += buflen1;
 		offset &= IOMMU_PAGE_MASK;
 		buflen -= buflen1;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202206210403.25L43fJd045435>