staging: rtl8723bs: core: Remove variable change_priority
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Mon, 10 Jun 2019 07:47:06 +0000 (13:17 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Jun 2019 09:47:01 +0000 (11:47 +0200)
Remove local variable change_priority, as it takes the value of the
argument priority; as both of these variables are of type u8, priority
can be modified without changing the value of its copy at the call site.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/core/rtw_xmit.c

index 53146ec..b5dcb78 100644 (file)
@@ -625,13 +625,11 @@ exit:
 
 u8 qos_acm(u8 acm_mask, u8 priority)
 {
-       u8 change_priority = priority;
-
        switch (priority) {
        case 0:
        case 3:
                if (acm_mask & BIT(1))
-                       change_priority = 1;
+                       priority = 1;
                break;
        case 1:
        case 2:
@@ -639,19 +637,19 @@ u8 qos_acm(u8 acm_mask, u8 priority)
        case 4:
        case 5:
                if (acm_mask & BIT(2))
-                       change_priority = 0;
+                       priority = 0;
                break;
        case 6:
        case 7:
                if (acm_mask & BIT(3))
-                       change_priority = 5;
+                       priority = 5;
                break;
        default:
                DBG_871X("qos_acm(): invalid pattrib->priority: %d!!!\n", priority);
                break;
        }
 
-       return change_priority;
+       return priority;
 }
 
 static void set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib)