]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
staging: ks7010: Change 'device_open_status' to a bool.
authorQuytelda Kahja <quytelda@tamalin.org>
Sat, 31 Mar 2018 06:08:52 +0000 (23:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Apr 2018 12:19:54 +0000 (14:19 +0200)
The 'device_open_status' member of 'struct ks_wlan_private' is only
ever set to zero or one, so it makes more sense for it to be a bool
instead of an int.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_wlan.h
drivers/staging/ks7010/ks_wlan_net.c

index eb0c14e78bd2574b8ebed98e178d197cde71ab58..efda12258d44d9e6d29031d31b17e07ba5fced3b 100644 (file)
@@ -443,7 +443,7 @@ struct ks_wlan_private {
        unsigned int need_commit;       /* for ioctl */
 
        /* DeviceIoControl */
-       int device_open_status;
+       bool device_open_status;
        atomic_t event_count;
        atomic_t rec_count;
        int dev_count;
index c4d94211b01bf2c1b280c31cd98237877d11ba16..9f9a51e96ab504cce3cd2edb8e87416f6351f42e 100644 (file)
@@ -2875,10 +2875,9 @@ int ks_wlan_net_start(struct net_device *dev)
 
        priv = netdev_priv(dev);
        priv->mac_address_valid = false;
+       priv->device_open_status = true;
        priv->need_commit = 0;
 
-       priv->device_open_status = 1;
-
        /* phy information update timer */
        atomic_set(&update_phyinfo, 0);
        timer_setup(&update_phyinfo_timer, ks_wlan_update_phyinfo_timeout, 0);
@@ -2908,7 +2907,7 @@ int ks_wlan_net_stop(struct net_device *dev)
 {
        struct ks_wlan_private *priv = netdev_priv(dev);
 
-       priv->device_open_status = 0;
+       priv->device_open_status = false;
        del_timer_sync(&update_phyinfo_timer);
 
        if (netif_running(dev))