staging: vt6656: Remove STATUS enums from TX path
authorMalcolm Priestley <tvboxspy@gmail.com>
Sat, 29 Feb 2020 19:29:55 +0000 (19:29 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Mar 2020 06:52:31 +0000 (07:52 +0100)
Returning standard error code or status variable.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/21bf299b-63e0-9f65-c7db-6e0b72e0f1d8@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/device.h
drivers/staging/vt6656/rxtx.c
drivers/staging/vt6656/usbpipe.c

index da868adba7c9dea2902e161081b5387e843c7198..5c9991415432c363748291674fb01c99fcfa2d9f 100644 (file)
@@ -256,15 +256,6 @@ struct vnt_interrupt_buffer {
        bool in_use;
 };
 
-/*++ NDIS related */
-
-enum {
-       STATUS_SUCCESS = 0,
-       STATUS_FAILURE,
-       STATUS_RESOURCES,
-       STATUS_PENDING,
-};
-
 /* flags for options */
 #define DEVICE_FLAGS_UNPLUG            0
 #define DEVICE_FLAGS_DISCONNECTED      1
index 1003808ac4ad0dbc091783c9f9d2ce8b0dd06798..9439d190f431978d3238e98d048c5f0452c89b60 100644 (file)
@@ -704,7 +704,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
 
        spin_lock_irqsave(&priv->lock, flags);
 
-       if (vnt_tx_context(priv, tx_context) != STATUS_PENDING) {
+       if (vnt_tx_context(priv, tx_context)) {
                spin_unlock_irqrestore(&priv->lock, flags);
                return -EIO;
        }
@@ -797,7 +797,7 @@ static int vnt_beacon_xmit(struct vnt_private *priv, struct sk_buff *skb)
 
        spin_lock_irqsave(&priv->lock, flags);
 
-       if (vnt_tx_context(priv, context) != STATUS_PENDING)
+       if (vnt_tx_context(priv, context))
                ieee80211_free_txskb(priv->hw, context->skb);
 
        spin_unlock_irqrestore(&priv->lock, flags);
index 7bfccc48a3666a523f2f235f737e5c7474c67350..e93c2175543f3f58e31ce4da70838953996c1ff8 100644 (file)
@@ -317,7 +317,7 @@ int vnt_tx_context(struct vnt_private *priv,
 
        if (test_bit(DEVICE_FLAGS_DISCONNECTED, &priv->flags)) {
                context->in_use = false;
-               return STATUS_RESOURCES;
+               return -ENODEV;
        }
 
        usb_fill_bulk_urb(urb,
@@ -333,8 +333,7 @@ int vnt_tx_context(struct vnt_private *priv,
                dev_dbg(&priv->usb->dev, "Submit Tx URB failed %d\n", status);
 
                context->in_use = false;
-               return STATUS_FAILURE;
        }
 
-       return STATUS_PENDING;
+       return status;
 }