summaryrefslogtreecommitdiffstats
path: root/coccinelle/sd_event_source_disable_unref.cocci
blob: 659aa00cf3246ef5cb7e9147c6fe0843b8661fb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression p;
@@
- if (p) {
-         (void) sd_event_source_set_enabled(p, SD_EVENT_OFF);
-         p = sd_event_source_unref(p);
- }
+ p = sd_event_source_disable_unref(p);
@@
expression p;
@@
- if (p) {
-         sd_event_source_set_enabled(p, SD_EVENT_OFF);
-         sd_event_source_unref(p);
- }
+ sd_event_source_disable_unref(p);
@@
expression p;
@@
- if (p) {
-         (void) sd_event_source_set_enabled(p, SD_EVENT_OFF);
-         sd_event_source_unref(p);
- }
+ sd_event_source_disable_unref(p);
@@
expression p;
@@
- (void) sd_event_source_set_enabled(p, SD_EVENT_OFF);
- sd_event_source_unref(p);
+ sd_event_source_disable_unref(p);
@@
expression p;
@@
- sd_event_source_set_enabled(p, SD_EVENT_OFF);
- sd_event_source_unref(p);
+ sd_event_source_disable_unref(p);