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. Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx> --- 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(-) diff --git a/check_allocation_funcs.c b/check_allocation_funcs.c index 63fb3ff9c44c..4972907f07f7 100644 --- a/check_allocation_funcs.c +++ b/check_allocation_funcs.c @@ -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", diff --git a/smatch_buf_comparison.c b/smatch_buf_comparison.c index 271ea37dd963..29036becd37b 100644 --- a/smatch_buf_comparison.c +++ b/smatch_buf_comparison.c @@ -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); diff --git a/smatch_buf_size.c b/smatch_buf_size.c index 139066c09360..b341d74a6f68 100644 --- a/smatch_buf_size.c +++ b/smatch_buf_size.c @@ -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); diff --git a/smatch_constraints_required.c b/smatch_constraints_required.c index 0fb4d40af265..29960a264aa3 100644 --- a/smatch_constraints_required.c +++ b/smatch_constraints_required.c @@ -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); diff --git a/smatch_fresh_alloc.c b/smatch_fresh_alloc.c index fda4bdcf203d..a918a3d06e5d 100644 --- a/smatch_fresh_alloc.c +++ b/smatch_fresh_alloc.c @@ -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}, -- 2.34.1