1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03:00
systemd/coccinelle/redundant-if.cocci

55 lines
724 B
Plaintext
Raw Normal View History

2018-11-16 16:42:14 +03:00
@@
expression r;
@@
- if (r < 0)
- return r;
- if (r == 0)
- return 0;
+ if (r <= 0)
+ return r;
@@
expression r;
@@
- if (r == 0)
- return 0;
- if (r < 0)
- return r;
+ if (r <= 0)
+ return r;
@@
expression r;
@@
- if (r < 0)
- return r;
- if (r == 0)
- return r;
+ if (r <= 0)
+ return r;
@@
expression r;
@@
- if (r == 0)
- return r;
- if (r < 0)
- return r;
+ if (r <= 0)
+ return r;
@@
expression r;
@@
- if (r < 0)
- return r;
- if (r > 0)
- return r;
+ if (r != 0)
+ return r;
@@
expression r;
@@
- if (r > 0)
- return r;
- if (r < 0)
- return r;
+ if (r != 0)
+ return r;