staging: rtl8192e: replace variable with direct return
authorMichael Straube <straube.linux@gmail.com>
Tue, 12 Mar 2024 05:18:16 +0000 (06:18 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Mar 2024 18:00:47 +0000 (19:00 +0100)
Remove the variable rt_status from rtl92e_send_cmd_pkt() and return
true/false directly to improve readability.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20240312051816.18717-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c

index 7f0c160bc7419f3b38ac9b77cca27bb0b998ea06..e470b49b0ff784bebb5a4c68d79e4913544312aa 100644 (file)
@@ -11,7 +11,6 @@
 bool rtl92e_send_cmd_pkt(struct net_device *dev, u32 type, const void *data,
                         u32 len)
 {
-       bool                            rt_status = true;
        struct r8192_priv *priv = rtllib_priv(dev);
        u16                             frag_length = 0, frag_offset = 0;
        struct sk_buff          *skb;
@@ -37,10 +36,8 @@ bool rtl92e_send_cmd_pkt(struct net_device *dev, u32 type, const void *data,
                else
                        skb = dev_alloc_skb(frag_length + 4);
 
-               if (!skb) {
-                       rt_status = false;
-                       goto Failed;
-               }
+               if (!skb)
+                       return false;
 
                memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
                tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
@@ -77,6 +74,6 @@ bool rtl92e_send_cmd_pkt(struct net_device *dev, u32 type, const void *data,
        } while (frag_offset < len);
 
        rtl92e_writeb(dev, TP_POLL, TP_POLL_CQ);
-Failed:
-       return rt_status;
+
+       return true;
 }