Repository navigation
Commit b2bda2f
bnx2x: Remove useless return variables
This patch remove variables that are initialized with a constant,
are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.
Verified by compilation only.
The coccinelle script that find and fixes this issue is:
// <smpl>
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
when strict
return
- ret
+ C
;
// </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 3afc557 commit b2bda2f
1 file changed
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2218 | 2218 | | |
2219 | 2219 | | |
2220 | 2220 | | |
2221 | | - | |
2222 | 2221 | | |
2223 | 2222 | | |
2224 | 2223 | | |
| |||
2232 | 2231 | | |
2233 | 2232 | | |
2234 | 2233 | | |
2235 | | - | |
| 2234 | + | |
2236 | 2235 | | |
2237 | 2236 | | |
2238 | 2237 | | |
| |||
2246 | 2245 | | |
2247 | 2246 | | |
2248 | 2247 | | |
2249 | | - | |
| 2248 | + | |
2250 | 2249 | | |
2251 | 2250 | | |
2252 | 2251 | | |
| |||
2260 | 2259 | | |
2261 | 2260 | | |
2262 | 2261 | | |
2263 | | - | |
| 2262 | + | |
2264 | 2263 | | |
2265 | 2264 | | |
2266 | 2265 | | |
| |||
6473 | 6472 | | |
6474 | 6473 | | |
6475 | 6474 | | |
6476 | | - | |
6477 | 6475 | | |
6478 | 6476 | | |
6479 | 6477 | | |
| |||
6546 | 6544 | | |
6547 | 6545 | | |
6548 | 6546 | | |
6549 | | - | |
| 6547 | + | |
6550 | 6548 | | |
6551 | 6549 | | |
6552 | 6550 | | |
| |||
0 commit comments