* [PATCH] Remove pci_alloc_consistent() and pci_alloc_coherent() checks
@ 2022-05-26 14:18 Christophe JAILLET
2022-05-26 14:40 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2022-05-26 14:18 UTC (permalink / raw)
To: smatch; +Cc: 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.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Remove pci_alloc_consistent() and pci_alloc_coherent() checks
2022-05-26 14:18 [PATCH] Remove pci_alloc_consistent() and pci_alloc_coherent() checks Christophe JAILLET
@ 2022-05-26 14:40 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2022-05-26 14:40 UTC (permalink / raw)
To: Christophe JAILLET; +Cc: smatch
On Thu, May 26, 2022 at 04:18:55PM +0200, Christophe JAILLET wrote:
> 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@wanadoo.fr>
Applied!
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-26 14:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-26 14:18 [PATCH] Remove pci_alloc_consistent() and pci_alloc_coherent() checks Christophe JAILLET
2022-05-26 14:40 ` Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.