systemd/coccinelle/redundant-if.cocci
2018-11-16 16:05:29 +01:00

55 lines
724 B
Plaintext

@@
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;