svn commit: r366111 - head/sys/arm64/arm64
Andrew Turner
andrew at FreeBSD.org
Thu Sep 24 10:42:29 UTC 2020
Author: andrew
Date: Thu Sep 24 10:42:28 2020
New Revision: 366111
URL: https://svnweb.freebsd.org/changeset/base/366111
Log:
Clean up the arm64 bus_dma_run_filter
- We can exit the loop as soon as the filter check passes.
- The alignment check has already passed so there is no need to also run
it here.
Sponsored by: Innovate UK
Modified:
head/sys/arm64/arm64/busdma_machdep.c
Modified: head/sys/arm64/arm64/busdma_machdep.c
==============================================================================
--- head/sys/arm64/arm64/busdma_machdep.c Thu Sep 24 10:40:49 2020 (r366110)
+++ head/sys/arm64/arm64/busdma_machdep.c Thu Sep 24 10:42:28 2020 (r366111)
@@ -99,19 +99,17 @@ bus_dma_dflt_lock(void *arg, bus_dma_lock_op_t op)
int
bus_dma_run_filter(struct bus_dma_tag_common *tc, bus_addr_t paddr)
{
- int retval;
- retval = 0;
- do {
- if (((paddr > tc->lowaddr && paddr <= tc->highaddr) ||
- ((paddr & (tc->alignment - 1)) != 0)) &&
+ while (tc != NULL) {
+ if ((paddr > tc->lowaddr && paddr <= tc->highaddr) &&
(tc->filter == NULL ||
(*tc->filter)(tc->filterarg, paddr) != 0))
- retval = 1;
+ return (1);
tc = tc->parent;
- } while (retval == 0 && tc != NULL);
- return (retval);
+ }
+
+ return (0);
}
int
More information about the svn-src-all
mailing list