Thread (16 messages) 16 messages, 4 authors, 2022-11-05

Re: [PATCH v4a 00/38] timers: Use timer_shutdown*() before freeing timers

From: "Jason A. Donenfeld" <Jason@zx2c4.com>
Date: 2022-11-05 21:03:46
Also in: alsa-devel, bridge, cgroups, dri-devel, intel-gfx, intel-wired-lan, linux-acpi, linux-block, linux-bluetooth, linux-doc, linux-edac, linux-ext4, linux-input, linux-leds, linux-media, linux-nfs, linux-pm, linux-s390, linux-scsi, linux-sh, linux-staging, linux-usb, lkml, lvs-devel, netdev, netfilter-devel, rcu

On Sat, Nov 05, 2022 at 12:36:42PM -0400, Steven Rostedt wrote:
----------------------8<------------------------
@@
identifier ptr, timer, rfield, slab;
@@
(
-	del_timer(&ptr->timer);
+	timer_shutdown(&ptr->timer);
|
-	del_timer_sync(&ptr->timer);
+	timer_shutdown_sync(&ptr->timer);
)
    ...
(
	kfree_rcu(ptr, rfield);
|
	kmem_cache_free(slab, ptr);
|
	kfree(ptr);
)
---------------------->8------------------------
Something that might help here is changing the `...` into
`... when exists` or into `... when != ptr` or similar.
See this section of the manual:
https://coccinelle.gitlabpages.inria.fr/website/docs/main_grammar004.html

Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help