Skip to contentSkip to conversation

Remove pci_alloc_consistent() and pci_alloc_coherent() checks

PATCH Applied Christophe JAILLET 2 participants 2 messages May 26, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove pci_alloc_consistent() and pci_alloc_coherent() checks

pci_alloc_consistent() and pci_alloc_coherent() are no more part of the kernel.

Remove the corresponding code that can never match and add dma_alloc_coherent() in places where it was missing.

---
 check_allocation_funcs.c      | 2 --
 smatch_buf_comparison.c       | 3 +--
 smatch_buf_size.c             | 2 --
 smatch_constraints_required.c | 6 ++----
 smatch_fresh_alloc.c          | 3 +--
 5 files changed, 4 insertions(+), 12 deletions(-)
check_allocation_funcs.c +0 -2
index 63fb3ff9c44c..4972907f07f7 100644
@@ -47,8 +47,6 @@ static const char *allocation_funcs[] = {
 	"kmemdup",
 	"memdup_user",
 	"dma_alloc_attrs",
-	"pci_alloc_consistent",
-	"pci_alloc_coherent",
 	"devm_kmalloc",
 	"devm_kzalloc",
 	"krealloc",
smatch_buf_comparison.c +1 -2
index 271ea37dd963..29036becd37b 100644
@@ -870,8 +870,7 @@ void register_buf_comparison(int id)
 		add_allocation_function("kmemdup", &match_alloc, 1);
 		add_allocation_function("memdup_user", &match_alloc, 1);
 		add_allocation_function("dma_alloc_attrs", &match_alloc, 1);
-		add_allocation_function("pci_alloc_consistent", &match_alloc, 1);
-		add_allocation_function("pci_alloc_coherent", &match_alloc, 1);
+		add_allocation_function("dma_alloc_coherent", &match_alloc, 1);
 		add_allocation_function("devm_kmalloc", &match_alloc, 1);
 		add_allocation_function("devm_kzalloc", &match_alloc, 1);
 		add_allocation_function("kcalloc", &match_calloc, 0);
smatch_buf_size.c +0 -2
index 139066c09360..b341d74a6f68 100644
@@ -1032,8 +1032,6 @@ void register_buf_size(int id)
 		add_allocation_function("kmemdup", &match_alloc, 1);
 		add_allocation_function("memdup_user", &match_alloc, 1);
 		add_allocation_function("dma_alloc_attrs", &match_alloc, 1);
-		add_allocation_function("pci_alloc_consistent", &match_alloc, 1);
-		add_allocation_function("pci_alloc_coherent", &match_alloc, 1);
 		add_allocation_function("devm_kmalloc", &match_alloc, 1);
 		add_allocation_function("devm_kzalloc", &match_alloc, 1);
 		add_allocation_function("krealloc", &match_alloc, 1);
smatch_constraints_required.c +2 -4
index 0fb4d40af265..29960a264aa3 100644
@@ -42,8 +42,7 @@ static struct allocator kernel_allocator_table[] = {
 	{"kmemdup", 1},
 	{"memdup_user", 1},
 	{"dma_alloc_attrs", 1},
-	{"pci_alloc_consistent", 1},
-	{"pci_alloc_coherent", 1},
+	{"dma_alloc_coherent", 1},
 	{"devm_kmalloc", 1},
 	{"devm_kzalloc", 1},
 	{"krealloc", 1},
@@ -484,8 +483,7 @@ void register_constraints_required(int id)
 		add_allocation_function("kmemdup", &match_alloc, 1);
 		add_allocation_function("memdup_user", &match_alloc, 1);
 		add_allocation_function("dma_alloc_attrs", &match_alloc, 1);
-		add_allocation_function("pci_alloc_consistent", &match_alloc, 1);
-		add_allocation_function("pci_alloc_coherent", &match_alloc, 1);
+		add_allocation_function("dma_alloc_coherent", &match_alloc, 1);
 		add_allocation_function("devm_kmalloc", &match_alloc, 1);
 		add_allocation_function("devm_kzalloc", &match_alloc, 1);
 		add_allocation_function("kcalloc", &match_calloc, 0);
smatch_fresh_alloc.c +1 -2
index fda4bdcf203d..a918a3d06e5d 100644
@@ -46,8 +46,7 @@ struct alloc_info kernel_allocation_funcs[] = {
 	{"kmemdup", 1},
 	{"memdup_user", 1},
 	{"dma_alloc_attrs", 1},
-	{"pci_alloc_consistent", 1},
-	{"pci_alloc_coherent", 1},
+	{"dma_alloc_coherent", 1},
 	{"devm_kmalloc", 1},
 	{"devm_kzalloc", 1},
 	{"krealloc", 1},
Signature · 1 line
2.34.1
#1 lore raw
Quoted 7 lines · Christophe JAILLET

pci_alloc_consistent() and pci_alloc_coherent() are no more part of the kernel.

Remove the corresponding code that can never match and add dma_alloc_coherent() in places where it was missing.

Applied!

regards,
dan carpenter