aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/gdm72xx
diff options
context:
space:
mode:
authorPeter Huewe <peterhuewe@gmx.de>2013-02-19 18:50:20 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-11 09:25:54 -0700
commitd38529100d0f2e844df5f06d67dae8dd32086ec1 (patch)
treefd3ef582211163dac1b7006c45d417674737e4c6 /drivers/staging/gdm72xx
parenteb986df15c86b66a51f6e82f4706bc825444670b (diff)
staging/gdm72xx: Remove duplicated code in gdm_qos.c
The first branch of the if statement is ended with a return thus there is no need for an else if, and thus we can move the duplicated code to the top and use it for the other two branches. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/gdm72xx')
-rw-r--r--drivers/staging/gdm72xx/gdm_qos.c42
1 files changed, 17 insertions, 25 deletions
diff --git a/drivers/staging/gdm72xx/gdm_qos.c b/drivers/staging/gdm72xx/gdm_qos.c
index d48994befeb..b795353e834 100644
--- a/drivers/staging/gdm72xx/gdm_qos.c
+++ b/drivers/staging/gdm72xx/gdm_qos.c
@@ -365,20 +365,24 @@ void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int size)
spin_unlock_irqrestore(&qcb->qos_lock, flags);
send_qos_list(nic, &send_list);
return;
- } else if (subCmdEvt == QOS_ADD) {
- pos = 6;
-
- SFID = ((buf[pos++]<<24)&0xff000000);
- SFID += ((buf[pos++]<<16)&0xff0000);
- SFID += ((buf[pos++]<<8)&0xff00);
- SFID += (buf[pos++]);
-
- index = get_csr(qcb, SFID, 1);
- if (index == -1) {
- netdev_err(nic->netdev, "QoS ERROR: csr Update Error\n");
- return;
- }
+ }
+ /* subCmdEvt == QOS_ADD || subCmdEvt == QOS_CHANG_DEL */
+ pos = 6;
+ SFID = ((buf[pos++]<<24)&0xff000000);
+ SFID += ((buf[pos++]<<16)&0xff0000);
+ SFID += ((buf[pos++]<<8)&0xff00);
+ SFID += (buf[pos++]);
+
+ index = get_csr(qcb, SFID, 1);
+ if (index == -1) {
+ netdev_err(nic->netdev,
+ "QoS ERROR: csr Update Error / Wrong index (%d) \n",
+ index);
+ return;
+ }
+
+ if (subCmdEvt == QOS_ADD) {
netdev_dbg(nic->netdev, "QOS_ADD SFID = 0x%x, index=%d\n",
SFID, index);
@@ -420,18 +424,6 @@ void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int size)
qcb->qos_limit_size = 254/qcb->qos_list_cnt;
spin_unlock_irqrestore(&qcb->qos_lock, flags);
} else if (subCmdEvt == QOS_CHANGE_DEL) {
- pos = 6;
- SFID = ((buf[pos++]<<24)&0xff000000);
- SFID += ((buf[pos++]<<16)&0xff0000);
- SFID += ((buf[pos++]<<8)&0xff00);
- SFID += (buf[pos++]);
- index = get_csr(qcb, SFID, 1);
- if (index == -1) {
- netdev_err(nic->netdev, "QoS ERROR: Wrong index(%d)\n",
- index);
- return;
- }
-
netdev_dbg(nic->netdev, "QOS_CHANGE_DEL SFID = 0x%x, index=%d\n",
SFID, index);