Thread (2 messages) 2 messages, 2 authors, 2014-06-02

Re: [PATCH 11/11] drivers/net/ethernet/intel: Remove useless return variables

From: Jeff Kirsher <hidden>
Date: 2014-06-02 01:11:52
Also in: kernel-janitors, lkml

On Sat, 2014-05-31 at 10:14 -0300, Peter Senna Tschudin wrote:
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>

---
 drivers/net/ethernet/intel/i40e/i40e_adminq.c   |   12 +++---------
 drivers/net/ethernet/intel/i40evf/i40e_adminq.c |   12 +++---------
 drivers/net/ethernet/intel/igb/e1000_82575.c    |   22
++++++++--------------
 3 files changed, 14 insertions(+), 32 deletions(-)
I have added this patch to my queue, thanks.

Attachments

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