Re: [PATCH 4/7] coccinelle: pool_zalloc-simple: drop the pci_pool_alloc rules

From: Julia Lawall

Date: Sun Aug 30 2026 - 05:22:39 EST




----- Mail original -----
> De: "Sang-Heon Jeon" <ekffu200098@xxxxxxxxx>
> À: "Julia Lawall" <Julia.Lawall@xxxxxxxx>, "nicolas palix" <nicolas.palix@xxxxxxx>
> Cc: "cocci" <cocci@xxxxxxxx>, "linux-kernel" <linux-kernel@xxxxxxxxxxxxxxx>
> Envoyé: Dimanche 23 Août 2026 18:18:16
> Objet: [PATCH 4/7] coccinelle: pool_zalloc-simple: drop the pci_pool_alloc rules

> pci_pool_alloc() and pci_pool_zalloc() were removed by commit
> 88dee3b0efe4 ("PCI: Remove unused pci_pool wrappers").
>
> So drop the pci_pool_alloc rules.
>
> No functional change.

Applied. In the last SmPL rule, I removed the \(\) in the + code and move the @p one space to the left, to more obviously attach to the =.

julia

> Signed-off-by: Sang-Heon Jeon <ekffu200098@xxxxxxxxx>
> ---
> .../api/alloc/pool_zalloc-simple.cocci | 17 +++--------------
> 1 file changed, 3 insertions(+), 14 deletions(-)
>
> diff --git a/scripts/coccinelle/api/alloc/pool_zalloc-simple.cocci
> b/scripts/coccinelle/api/alloc/pool_zalloc-simple.cocci
> index 9c61a23b34db..2c36fb70e0ab 100644
> --- a/scripts/coccinelle/api/alloc/pool_zalloc-simple.cocci
> +++ b/scripts/coccinelle/api/alloc/pool_zalloc-simple.cocci
> @@ -5,7 +5,7 @@
> // Copyright: (C) 2015 Intel Corp.
> // Options: --no-includes --include-headers
> //
> -// Keywords: dma_pool_zalloc, pci_pool_zalloc
> +// Keywords: dma_pool_zalloc
> //
>
> virtual context
> @@ -22,7 +22,7 @@ expression x;
> statement S;
> @@
>
> -* x = \(dma_pool_alloc\|pci_pool_alloc\)(...);
> +* x = dma_pool_alloc(...);
> if ((x==NULL) || ...) S
> * memset(x,0, ...);
>
> @@ -41,17 +41,6 @@ statement S;
> if ((x==NULL) || ...) S
> - memset(x,0,...);
>
> -@depends on patch@
> -expression x;
> -expression a,b,c;
> -statement S;
> -@@
> -
> -- x = pci_pool_alloc(a,b,c);
> -+ x = pci_pool_zalloc(a,b,c);
> - if ((x==NULL) || ...) S
> -- memset(x,0,...);
> -
> //----------------------------------------------------------
> // For org and report mode
> //----------------------------------------------------------
> @@ -63,7 +52,7 @@ statement S;
> position p;
> @@
>
> - x = @p\(dma_pool_alloc\|pci_pool_alloc\)(a,b,c);
> + x = @p\(dma_pool_alloc\)(a,b,c);
> if ((x==NULL) || ...) S
> memset(x,0, ...);
>
> --
> 2.43.0