diff options
author | Frank Pavlic <fpavlic@de.ibm.com> | 2006-03-22 10:03:41 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-03-22 20:29:30 -0500 |
commit | 1380fee2b553fbde1a094476685f43ec5625aec2 (patch) | |
tree | be0fb1266ce2706b624a157ed64de97a9c25ff67 /drivers/s390/net/qeth_main.c | |
parent | 95f6b5a1e38e26dc313e283e1e6058d3ffff517d (diff) |
[PATCH] s390: qeth driver cleanups
[patch 3/6] s390: qeth driver cleanups
From: Ursula Braun <braunu@de.ibm.com>
- code analyzing tool BEAM has found some unreachable
and unnecessary statements and also conditions
which are always true.
- removed some useless MII code since OSA card will never
allow to set such values.
Signed-off-by: Frank Pavlic <fpavlic@de.ibm.com>
diffstat:
qeth_main.c | 49 ++++---------------------------------------------
qeth_proc.c | 18 +++++++++---------
qeth_sys.c | 2 +-
3 files changed, 14 insertions(+), 55 deletions(-)
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/s390/net/qeth_main.c')
-rw-r--r-- | drivers/s390/net/qeth_main.c | 49 |
1 files changed, 4 insertions, 45 deletions
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 634c3958f426..69329ea61e2b 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c | |||
@@ -1364,7 +1364,7 @@ qeth_wait_for_buffer(struct qeth_channel *channel) | |||
1364 | static void | 1364 | static void |
1365 | qeth_clear_cmd_buffers(struct qeth_channel *channel) | 1365 | qeth_clear_cmd_buffers(struct qeth_channel *channel) |
1366 | { | 1366 | { |
1367 | int cnt = 0; | 1367 | int cnt; |
1368 | 1368 | ||
1369 | for (cnt=0; cnt < QETH_CMD_BUFFER_NO; cnt++) | 1369 | for (cnt=0; cnt < QETH_CMD_BUFFER_NO; cnt++) |
1370 | qeth_release_buffer(channel,&channel->iob[cnt]); | 1370 | qeth_release_buffer(channel,&channel->iob[cnt]); |
@@ -2814,11 +2814,11 @@ qeth_handle_send_error(struct qeth_card *card, | |||
2814 | QETH_DBF_TEXT_(trace,1,"%s",CARD_BUS_ID(card)); | 2814 | QETH_DBF_TEXT_(trace,1,"%s",CARD_BUS_ID(card)); |
2815 | return QETH_SEND_ERROR_LINK_FAILURE; | 2815 | return QETH_SEND_ERROR_LINK_FAILURE; |
2816 | case 3: | 2816 | case 3: |
2817 | default: | ||
2817 | QETH_DBF_TEXT(trace, 1, "SIGAcc3"); | 2818 | QETH_DBF_TEXT(trace, 1, "SIGAcc3"); |
2818 | QETH_DBF_TEXT_(trace,1,"%s",CARD_BUS_ID(card)); | 2819 | QETH_DBF_TEXT_(trace,1,"%s",CARD_BUS_ID(card)); |
2819 | return QETH_SEND_ERROR_KICK_IT; | 2820 | return QETH_SEND_ERROR_KICK_IT; |
2820 | } | 2821 | } |
2821 | return QETH_SEND_ERROR_LINK_FAILURE; | ||
2822 | } | 2822 | } |
2823 | 2823 | ||
2824 | void | 2824 | void |
@@ -3865,6 +3865,7 @@ qeth_get_cast_type(struct qeth_card *card, struct sk_buff *skb) | |||
3865 | if ((hdr_mac == QETH_TR_MAC_NC) || | 3865 | if ((hdr_mac == QETH_TR_MAC_NC) || |
3866 | (hdr_mac == QETH_TR_MAC_C)) | 3866 | (hdr_mac == QETH_TR_MAC_C)) |
3867 | return RTN_MULTICAST; | 3867 | return RTN_MULTICAST; |
3868 | break; | ||
3868 | /* eth or so multicast? */ | 3869 | /* eth or so multicast? */ |
3869 | default: | 3870 | default: |
3870 | if ((hdr_mac == QETH_ETH_MAC_V4) || | 3871 | if ((hdr_mac == QETH_ETH_MAC_V4) || |
@@ -4586,38 +4587,11 @@ qeth_mdio_read(struct net_device *dev, int phy_id, int regnum) | |||
4586 | case MII_NCONFIG: /* network interface config */ | 4587 | case MII_NCONFIG: /* network interface config */ |
4587 | break; | 4588 | break; |
4588 | default: | 4589 | default: |
4589 | rc = 0; | ||
4590 | break; | 4590 | break; |
4591 | } | 4591 | } |
4592 | return rc; | 4592 | return rc; |
4593 | } | 4593 | } |
4594 | 4594 | ||
4595 | static void | ||
4596 | qeth_mdio_write(struct net_device *dev, int phy_id, int regnum, int value) | ||
4597 | { | ||
4598 | switch(regnum){ | ||
4599 | case MII_BMCR: /* Basic mode control register */ | ||
4600 | case MII_BMSR: /* Basic mode status register */ | ||
4601 | case MII_PHYSID1: /* PHYS ID 1 */ | ||
4602 | case MII_PHYSID2: /* PHYS ID 2 */ | ||
4603 | case MII_ADVERTISE: /* Advertisement control reg */ | ||
4604 | case MII_LPA: /* Link partner ability reg */ | ||
4605 | case MII_EXPANSION: /* Expansion register */ | ||
4606 | case MII_DCOUNTER: /* disconnect counter */ | ||
4607 | case MII_FCSCOUNTER: /* false carrier counter */ | ||
4608 | case MII_NWAYTEST: /* N-way auto-neg test register */ | ||
4609 | case MII_RERRCOUNTER: /* rx error counter */ | ||
4610 | case MII_SREVISION: /* silicon revision */ | ||
4611 | case MII_RESV1: /* reserved 1 */ | ||
4612 | case MII_LBRERROR: /* loopback, rx, bypass error */ | ||
4613 | case MII_PHYADDR: /* physical address */ | ||
4614 | case MII_RESV2: /* reserved 2 */ | ||
4615 | case MII_TPISTATUS: /* TPI status for 10mbps */ | ||
4616 | case MII_NCONFIG: /* network interface config */ | ||
4617 | default: | ||
4618 | break; | ||
4619 | } | ||
4620 | } | ||
4621 | 4595 | ||
4622 | static inline const char * | 4596 | static inline const char * |
4623 | qeth_arp_get_error_cause(int *rc) | 4597 | qeth_arp_get_error_cause(int *rc) |
@@ -5237,21 +5211,6 @@ qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
5237 | mii_data->val_out = qeth_mdio_read(dev,mii_data->phy_id, | 5211 | mii_data->val_out = qeth_mdio_read(dev,mii_data->phy_id, |
5238 | mii_data->reg_num); | 5212 | mii_data->reg_num); |
5239 | break; | 5213 | break; |
5240 | case SIOCSMIIREG: | ||
5241 | rc = -EOPNOTSUPP; | ||
5242 | break; | ||
5243 | /* TODO: remove return if qeth_mdio_write does something */ | ||
5244 | if (!capable(CAP_NET_ADMIN)){ | ||
5245 | rc = -EPERM; | ||
5246 | break; | ||
5247 | } | ||
5248 | mii_data = if_mii(rq); | ||
5249 | if (mii_data->phy_id != 0) | ||
5250 | rc = -EINVAL; | ||
5251 | else | ||
5252 | qeth_mdio_write(dev, mii_data->phy_id, mii_data->reg_num, | ||
5253 | mii_data->val_in); | ||
5254 | break; | ||
5255 | default: | 5214 | default: |
5256 | rc = -EOPNOTSUPP; | 5215 | rc = -EOPNOTSUPP; |
5257 | } | 5216 | } |
@@ -6901,7 +6860,7 @@ qeth_send_setassparms(struct qeth_card *card, struct qeth_cmd_buffer *iob, | |||
6901 | cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); | 6860 | cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); |
6902 | if (len <= sizeof(__u32)) | 6861 | if (len <= sizeof(__u32)) |
6903 | cmd->data.setassparms.data.flags_32bit = (__u32) data; | 6862 | cmd->data.setassparms.data.flags_32bit = (__u32) data; |
6904 | else if (len > sizeof(__u32)) | 6863 | else /* (len > sizeof(__u32)) */ |
6905 | memcpy(&cmd->data.setassparms.data, (void *) data, len); | 6864 | memcpy(&cmd->data.setassparms.data, (void *) data, len); |
6906 | 6865 | ||
6907 | rc = qeth_send_ipa_cmd(card, iob, reply_cb, reply_param); | 6866 | rc = qeth_send_ipa_cmd(card, iob, reply_cb, reply_param); |