aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Horne <mhorne@FreeBSD.org>2023-12-04 15:46:48 +0000
committerMitchell Horne <mhorne@FreeBSD.org>2023-12-06 23:23:14 +0000
commit165cc0eea9d1e35bc448e8b329ed1919fba6bcd3 (patch)
tree0ec2335bf7605de706d58167a137ede515a77128
parente64d827d3a582af994288fcdbc5a701828fc66d6 (diff)
downloadsrc-165cc0eea9d1e35bc448e8b329ed1919fba6bcd3.tar.gz
src-165cc0eea9d1e35bc448e8b329ed1919fba6bcd3.zip
busdma: emit a warning for use of filters
Filter functions are deprecated, and unused in the tree. If either of the filter or filterarg arguments to bus_dma_tag_create() are non-NULL, print a warning. This is a direct commit to stable/14. Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42897
-rw-r--r--sys/arm/arm/busdma_machdep.c4
-rw-r--r--sys/arm64/arm64/busdma_machdep.c4
-rw-r--r--sys/powerpc/powerpc/busdma_machdep.c4
-rw-r--r--sys/riscv/riscv/busdma_machdep.c4
-rw-r--r--sys/x86/x86/busdma_machdep.c4
5 files changed, 20 insertions, 0 deletions
diff --git a/sys/arm/arm/busdma_machdep.c b/sys/arm/arm/busdma_machdep.c
index 07a3da114441..8dd4f3bff23d 100644
--- a/sys/arm/arm/busdma_machdep.c
+++ b/sys/arm/arm/busdma_machdep.c
@@ -398,6 +398,10 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
/* Return a NULL tag on failure */
*dmat = NULL;
+ /* Filters are deprecated, emit a warning. */
+ if (filter != NULL || filterarg != NULL)
+ printf("Warning: use of filters is deprecated; see busdma(9)\n");
+
newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_BUSDMA,
M_ZERO | M_NOWAIT);
if (newtag == NULL) {
diff --git a/sys/arm64/arm64/busdma_machdep.c b/sys/arm64/arm64/busdma_machdep.c
index 14fd96ac919c..c1b710e3538d 100644
--- a/sys/arm64/arm64/busdma_machdep.c
+++ b/sys/arm64/arm64/busdma_machdep.c
@@ -161,6 +161,10 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
struct bus_dma_tag_common *tc;
int error;
+ /* Filters are deprecated, emit a warning. */
+ if (filter != NULL || filterarg != NULL)
+ printf("Warning: use of filters is deprecated; see busdma(9)\n");
+
if (parent == NULL) {
error = bus_dma_bounce_impl.tag_create(parent, alignment,
boundary, lowaddr, highaddr, filter, filterarg, maxsize,
diff --git a/sys/powerpc/powerpc/busdma_machdep.c b/sys/powerpc/powerpc/busdma_machdep.c
index bffbfa94acac..873a67458dfc 100644
--- a/sys/powerpc/powerpc/busdma_machdep.c
+++ b/sys/powerpc/powerpc/busdma_machdep.c
@@ -168,6 +168,10 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
return (EINVAL);
}
+ /* Filters are deprecated, emit a warning. */
+ if (filter != NULL || filterarg != NULL)
+ printf("Warning: use of filters is deprecated; see busdma(9)\n");
+
/* Return a NULL tag on failure */
*dmat = NULL;
diff --git a/sys/riscv/riscv/busdma_machdep.c b/sys/riscv/riscv/busdma_machdep.c
index 19cfd21edc6e..e8aca33a86c0 100644
--- a/sys/riscv/riscv/busdma_machdep.c
+++ b/sys/riscv/riscv/busdma_machdep.c
@@ -162,6 +162,10 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
struct bus_dma_tag_common *tc;
int error;
+ /* Filters are deprecated, emit a warning. */
+ if (filter != NULL || filterarg != NULL)
+ printf("Warning: use of filters is deprecated; see busdma(9)\n");
+
if (parent == NULL) {
error = bus_dma_bounce_impl.tag_create(parent, alignment,
boundary, lowaddr, highaddr, filter, filterarg, maxsize,
diff --git a/sys/x86/x86/busdma_machdep.c b/sys/x86/x86/busdma_machdep.c
index 0e72b09684cc..ee614548aea7 100644
--- a/sys/x86/x86/busdma_machdep.c
+++ b/sys/x86/x86/busdma_machdep.c
@@ -184,6 +184,10 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
struct bus_dma_tag_common *tc;
int error;
+ /* Filters are deprecated, emit a warning. */
+ if (filter != NULL || filterarg != NULL)
+ printf("Warning: use of filters is deprecated; see busdma(9)\n");
+
if (parent == NULL) {
error = bus_dma_bounce_impl.tag_create(parent, alignment,
boundary, lowaddr, highaddr, filter, filterarg, maxsize,