Remove pci_alloc_consistent() and pci_alloc_coherent() checks
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.
Signed-off-by Christophe JAILLET <[email protected]>
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
Dan Carpenter
AppliedQuoted 7 lines · Christophe JAILLET
pci_alloc_consistent()andpci_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 <[email protected]>
Applied!
regards,
dan carpenter