s390: Remove unneeded variables
Subsystems (4)
PATCH 2/2 s390: Remove unneeded variables
This patch remove unneeded variables used to store return values.
These issues were detected with the Coccinelle script:scripts/coccinelle/misc/returnvar.cocci
Signed-off-by Peter Senna Tschudin <[email protected]>
---
Tested by cross compilation only.
drivers/s390/cio/eadm_sch.c | 3 +-- drivers/s390/net/qeth_l2_main.c | 5 ++--- drivers/s390/net/qeth_l3_main.c | 5 ++--- 3 files changed, 5 insertions(+), 8 deletions(-)
drivers/s390/cio/eadm_sch.c +1 -2
@@ -336,7 +336,6 @@ static int eadm_subchannel_sch_event(struct subchannel *sch, int process) {struct eadm_private *private;unsigned long flags; -int ret =0 ;spin_lock_irqsave (sch->lock, flags);if (!device_is_registered (&sch->dev))
@@ -356,7 +355,7 @@ static int eadm_subchannel_sch_event(struct subchannel *sch, int process) out_unlock:spin_unlock_irqrestore (sch->lock, flags); -return ret; +return 0 ; }static struct css_device_id eadm_subchannel_ids[] = {
drivers/s390/net/qeth_l2_main.c +2 -3
@@ -392,8 +392,6 @@ static int qeth_l2_vlan_rx_kill_vid(struct net_device *dev,static int qeth_l2_stop_card (struct qeth_card *card,int recovery_mode) { -int rc =0 ; -QETH_DBF_TEXT (SETUP ,2 ,"stopcard" );QETH_DBF_HEX (SETUP ,2 , &card,sizeof (void *));
@@ -427,7 +425,8 @@ static int qeth_l2_stop_card(struct qeth_card *card, int recovery_mode)qeth_clear_cmd_buffers (&card->read);qeth_clear_cmd_buffers (&card->write); } -return rc; + +return 0 ; } static int qeth_l2_process_inbound_buffer(struct qeth_card *card,
drivers/s390/net/qeth_l3_main.c +2 -3
@@ -2160,8 +2160,6 @@ static struct qeth_card *qeth_l3_get_card_from_dev(struct net_device *dev)static int qeth_l3_stop_card (struct qeth_card *card,int recovery_mode) { -int rc =0 ; -QETH_DBF_TEXT (SETUP ,2 ,"stopcard" );QETH_DBF_HEX (SETUP ,2 , &card,sizeof (void *));
@@ -2196,7 +2194,8 @@ static int qeth_l3_stop_card(struct qeth_card *card, int recovery_mode)qeth_clear_cmd_buffers (&card->read);qeth_clear_cmd_buffers (&card->write); } -return rc; + +return 0 ; }/*
Signature · 1 line
2.1.0
Heiko Carstens
AppliedQuoted 45 lines · Peter Senna Tschudin
This patch remove unneeded variables used to store return values.
These issues were detected with the Coccinelle script:
scripts/coccinelle/misc/returnvar.cocciSigned-off-by Peter Senna Tschudin <[email protected]>---
static structcss_device_ideadm_subchannel_ids[] = {drivers/s390/net/qeth_l2_main.c +2
-3@@ -392,8 +392,6 @@ static int qeth_l2_vlan_rx_kill_vid(struct net_device *dev,static int qeth_l2_stop_card (struct qeth_card *card,int recovery_mode) { -int rc =0 ; -QETH_DBF_TEXT (SETUP ,2 ,"stopcard" );QETH_DBF_HEX (SETUP ,2 , &card,sizeof (void *));@@ -427,7 +425,8 @@ static int qeth_l2_stop_card(struct qeth_card *card, int recovery_mode)qeth_clear_cmd_buffers (&card->read);qeth_clear_cmd_buffers (&card->write); } -return rc; + +return 0 ; } static int qeth_l2_process_inbound_buffer(struct qeth_card *card,drivers/s390/net/qeth_l3_main.c +0
-2@@ -2160,8 +2160,6 @@ static struct qeth_card *qeth_l3_get_card_from_dev(struct net_device *dev)static int qeth_l3_stop_card (struct qeth_card *card,int recovery_mode) { -int rc =0 ; -QETH_DBF_TEXT (SETUP ,2 ,"stopcard" );QETH_DBF_HEX (SETUP ,2 , &card,sizeof (void *));
drivers/s390/net/qeth_l3_main.c static int qeth_l3_stop_card(struct qeth_card *card, int recovery_mode) · line 2198
Quoted 6 lines
drivers/s390/net/qeth_l3_main.c +2
-1@@ -2196,7 +2194,8 @@ static int qeth_l3_stop_card(struct qeth_card *card, int recovery_mode)qeth_clear_cmd_buffers (&card->read);qeth_clear_cmd_buffers (&card->write); } -return rc; + +return 0 ;
Applied. However I changed your patch a bit and made the *_stop_card() functions return void instead, since the calling functions didn't care anyway.
Thanks!