]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: vt6656: struct vnt_private merge flag and macros
authorMalcolm Priestley <tvboxspy@gmail.com>
Thu, 24 Jul 2014 20:13:16 +0000 (21:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Jul 2014 22:09:59 +0000 (15:09 -0700)
merge u32 flag into unsigned long Flags

Replacing fMP_DISCONNECTED with DEVICE_FLAGS_DISCONNECTED

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/device.h
drivers/staging/vt6656/main_usb.c
drivers/staging/vt6656/usbpipe.c
drivers/staging/vt6656/wcmd.c

index ac4c7485463dab392627a59e962350c87c451652..fd7105ea1f66f56a2de406266a5b1a34faf09eae 100644 (file)
@@ -262,7 +262,8 @@ enum {
 };
 
 /* flags for options */
-#define     DEVICE_FLAGS_UNPLUG          0x00000001UL
+#define DEVICE_FLAGS_UNPLUG            BIT(0)
+#define DEVICE_FLAGS_DISCONNECTED      BIT(1)
 
 struct vnt_private {
        /* mac80211 */
@@ -281,8 +282,7 @@ struct vnt_private {
        spinlock_t lock;
        struct mutex usb_lock;
 
-       u32 flags;
-       unsigned long Flags;
+       unsigned long flags;
 
        /* USB */
        struct urb *interrupt_urb;
@@ -402,11 +402,9 @@ struct vnt_private {
                (uVar)++;                               \
 }
 
-#define fMP_DISCONNECTED                    0x00000002
-
-#define MP_SET_FLAG(_M, _F)             ((_M)->Flags |= (_F))
-#define MP_CLEAR_FLAG(_M, _F)            ((_M)->Flags &= ~(_F))
-#define MP_TEST_FLAGS(_M, _F)            (((_M)->Flags & (_F)) == (_F))
+#define MP_SET_FLAG(_M, _F)             ((_M)->flags |= (_F))
+#define MP_CLEAR_FLAG(_M, _F)            ((_M)->flags &= ~(_F))
+#define MP_TEST_FLAGS(_M, _F)            (((_M)->flags & (_F)) == (_F))
 
 int vnt_init(struct vnt_private *priv);
 
index 3cfbd31f94d17c86f923f31eb65b67cec73441c1..87feba52d240958c4deb94d3a01c5ce2516a88e7 100644 (file)
@@ -551,7 +551,7 @@ static int vnt_start(struct ieee80211_hw *hw)
                return -ENOMEM;
        }
 
-       MP_CLEAR_FLAG(priv, fMP_DISCONNECTED);
+       MP_CLEAR_FLAG(priv, DEVICE_FLAGS_DISCONNECTED);
 
        if (device_init_registers(priv) == false) {
                dev_dbg(&priv->usb->dev, " init register fail\n");
@@ -596,7 +596,7 @@ static void vnt_stop(struct ieee80211_hw *hw)
 
        ieee80211_stop_queues(hw);
 
-       MP_SET_FLAG(priv, fMP_DISCONNECTED);
+       MP_SET_FLAG(priv, DEVICE_FLAGS_DISCONNECTED);
 
        cancel_delayed_work_sync(&priv->run_command_work);
 
@@ -1025,7 +1025,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
 
        usb_device_reset(priv);
 
-       MP_CLEAR_FLAG(priv, fMP_DISCONNECTED);
+       MP_CLEAR_FLAG(priv, DEVICE_FLAGS_DISCONNECTED);
        vnt_reset_command_timer(priv);
 
        vnt_schedule_command(priv, WLAN_CMD_INIT_MAC80211);
index ab95a07ee15e8170870aecc70dfa4a70bcec47a8..b2722b9ac9061ea28557c4e6fd4c175b0ce87086 100644 (file)
@@ -52,7 +52,7 @@ int vnt_control_out(struct vnt_private *priv, u8 request, u16 value,
 {
        int status = 0;
 
-       if (priv->Flags & fMP_DISCONNECTED)
+       if (priv->flags & DEVICE_FLAGS_DISCONNECTED)
                return STATUS_FAILURE;
 
        mutex_lock(&priv->usb_lock);
@@ -80,7 +80,7 @@ int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,
 {
        int status;
 
-       if (priv->Flags & fMP_DISCONNECTED)
+       if (priv->flags & DEVICE_FLAGS_DISCONNECTED)
                return STATUS_FAILURE;
 
        mutex_lock(&priv->usb_lock);
@@ -289,7 +289,7 @@ int vnt_tx_context(struct vnt_private *priv,
        int status;
        struct urb *urb;
 
-       if (priv->Flags & fMP_DISCONNECTED) {
+       if (priv->flags & DEVICE_FLAGS_DISCONNECTED) {
                context->in_use = false;
                return STATUS_RESOURCES;
        }
index e4a5e2bead70e86e450e937f3569d6cfa6e04767..e5330e3ce4079c7c0084eaa7b518b72dccb156b5 100644 (file)
@@ -97,7 +97,7 @@ void vnt_run_command(struct work_struct *work)
        struct vnt_private *priv =
                container_of(work, struct vnt_private, run_command_work.work);
 
-       if (priv->Flags & fMP_DISCONNECTED)
+       if (priv->flags & DEVICE_FLAGS_DISCONNECTED)
                return;
 
        if (priv->cmd_running != true)