public inbox for cocci@systeme.lip6.fr
 help / color / mirror / Atom feed
* [cocci] Checking another deletion of redundant null pointer checks (with SmPL)?
@ 2025-06-10  8:55 Markus Elfring
  2025-06-10 15:43 ` Julia Lawall
  0 siblings, 1 reply; 17+ messages in thread
From: Markus Elfring @ 2025-06-10  8:55 UTC (permalink / raw)
  To: cocci

Hello,

I accidentally noticed an update candidate.

c4iw_rdev_open():
https://elixir.bootlin.com/linux/v6.15.1/source/drivers/infiniband/hw/cxgb4/device.c#L908-L909

I got into the mood to construct another script variant for the semantic patch language.

@deletion@
expression e;
@@
 if (...
-    && e
    )
    kfree(e);


A corresponding patch can be generated accordingly.

Markus_Elfring@Sonne:…/Projekte/Linux/next-analyses> time /usr/bin/spatch --no-loops …/Projekte/Coccinelle/janitor/delete_redundant_checks4.cocci drivers/infiniband/hw/cxgb4/device.c
…
@@ -905,7 +905,7 @@ static int c4iw_rdev_open(struct c4iw_rd
 
        return 0;
 err_free_status_page_and_wr_log:
-       if (c4iw_wr_log && rdev->wr_log)
+       if (c4iw_wr_log)
                kfree(rdev->wr_log);
        free_page((unsigned long)rdev->status_page);
 destroy_ocqp_pool:

real    0m0,454s
user    0m0,413s
sys     0m0,038s


I tried another program call out.

Markus_Elfring@Sonne:…/Projekte/Linux/next-analyses> git checkout next-20250606 && time /usr/bin/spatch --no-loops --timeout 45 -j4 --chunksize 1 -dir . …/Projekte/Coccinelle/janitor/delete_redundant_checks4.cocci > …/Projekte/Bau/Linux/scripts/Coccinelle/deletions1/next/20250606/delete_redundant_checks4.diff 2> …/Projekte/Bau/Linux/scripts/Coccinelle/deletions1/next/20250606/delete_redundant_checks4-errors.txt
…
real    5m42,692s
user    20m26,077s
sys     0m13,532s


Now I wonder why the known generated patch was not written into the specified
diff file for this command variant.
How will the desired data output become consistent (after the software
combination “Coccinelle 1.3.0”) for such an use case?

Regards,
Markus

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-06-13  8:47 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-10  8:55 [cocci] Checking another deletion of redundant null pointer checks (with SmPL)? Markus Elfring
2025-06-10 15:43 ` Julia Lawall
2025-06-10 16:15   ` Markus Elfring
2025-06-10 16:32     ` Julia Lawall
2025-06-10 16:40       ` Markus Elfring
     [not found]         ` <alpine.DEB.2.22.394.2506101850030.4658@hadrien>
2025-06-10 17:00           ` Markus Elfring
     [not found]             ` <alpine.DEB.2.22.394.2506101925310.4658@hadrien>
2025-06-10 18:33               ` Markus Elfring
2025-06-11  5:50               ` Markus Elfring
2025-06-12 10:40               ` Markus Elfring
2025-06-11 17:55   ` Markus Elfring
2025-06-12 12:54     ` Markus Elfring
2025-06-12 13:02       ` Julia Lawall
2025-06-12 14:23         ` Markus Elfring
2025-06-12 15:54         ` Keller, Jacob E
2025-06-12 16:04           ` Julia Lawall
2025-06-12 16:13             ` Keller, Jacob E
2025-06-13  8:46       ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox