All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergio Paracuellos <sergio.paracuellos@gmail.com>
To: gregkh@linuxfoundation.org
Cc: driverdev-devel@linuxdriverproject.org, wsa@the-dreams.de
Subject: [PATCH 02/10] staging: ks7010: change name and type for device_open_status field
Date: Mon, 16 Apr 2018 12:29:24 +0200	[thread overview]
Message-ID: <1523874572-25171-3-git-send-email-sergio.paracuellos@gmail.com> (raw)
In-Reply-To: <1523874572-25171-1-git-send-email-sergio.paracuellos@gmail.com>

This commit changes type for device_open_status field of ks_wlan_private
structure from int to bool. This variable is only be set to 1
on ks_wlan_net_start and set to 0 on ks_wlan_net_stop. For this
purpose it is not necessary at all to use an integer because a bool
is enough. This also renames field name from device_open_status to
is_device_open.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks_hostif.c   | 2 +-
 drivers/staging/ks7010/ks_wlan.h     | 2 +-
 drivers/staging/ks7010/ks_wlan_net.c | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index f6ac9f0..995cb9a 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -1569,7 +1569,7 @@ void hostif_mic_failure_request(struct ks_wlan_private *priv,
 static void devio_rec_ind(struct ks_wlan_private *priv, unsigned char *p,
 			  unsigned int size)
 {
-	if (priv->device_open_status) {
+	if (priv->is_device_open) {
 		spin_lock(&priv->dev_read_lock);	/* request spin lock */
 		priv->dev_data[atomic_read(&priv->rec_count)] = p;
 		priv->dev_size[atomic_read(&priv->rec_count)] = size;
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 1b7036c..c1bab57 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -443,7 +443,7 @@ struct ks_wlan_private {
 	unsigned int need_commit;	/* for ioctl */
 
 	/* DeviceIoControl */
-	int device_open_status;
+	bool is_device_open;
 	atomic_t event_count;
 	atomic_t rec_count;
 	int dev_count;
diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index c0cea2f..5a4d661 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -2877,7 +2877,7 @@ int ks_wlan_net_start(struct net_device *dev)
 	priv->mac_address_valid = false;
 	priv->need_commit = 0;
 
-	priv->device_open_status = 1;
+	priv->is_device_open = true;
 
 	/* phy information update timer */
 	atomic_set(&update_phyinfo, 0);
@@ -2908,7 +2908,7 @@ int ks_wlan_net_stop(struct net_device *dev)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 
-	priv->device_open_status = 0;
+	priv->is_device_open = false;
 	del_timer_sync(&update_phyinfo_timer);
 
 	if (netif_running(dev))
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2018-04-16 10:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-16 10:29 [PATCH 00/10] staging: ks7010: some new cleanups Sergio Paracuellos
2018-04-16 10:29 ` [PATCH 01/10] staging: ks7010: use linux circular buffer header macros to handle tx and rx queues Sergio Paracuellos
2018-04-23 12:30   ` Greg KH
2018-04-23 13:02     ` Sergio Paracuellos
2018-04-23 13:19       ` Greg KH
2018-04-23 13:22         ` Sergio Paracuellos
2018-04-16 10:29 ` Sergio Paracuellos [this message]
2018-04-16 10:29 ` [PATCH 03/10] staging: ks7010: avoid one level indentation in devio_rec_ind function Sergio Paracuellos
2018-04-16 10:29 ` [PATCH 04/10] staging: ks7010: remove superfluous comments in ks_hostif source file Sergio Paracuellos
2018-04-16 10:29 ` [PATCH 05/10] staging: ks7010: change return value of ks_wlan_do_power_save function Sergio Paracuellos
2018-04-16 10:29 ` [PATCH 06/10] staging: ks7010: remove nonsense break from case block Sergio Paracuellos
2018-04-16 10:29 ` [PATCH 07/10] staging: ks7010: refactor code for hostif_sme_sleep_set function Sergio Paracuellos
2018-04-16 10:29 ` [PATCH 08/10] staging: ks7010: fix warning aout long line in init_request Sergio Paracuellos
2018-04-16 10:29 ` [PATCH 09/10] staging: ks7010: avoid blank line between definitions in hostif_data_request Sergio Paracuellos
2018-04-16 10:29 ` [PATCH 10/10] staging: ks7010: group some cases in switch-case block in hostif_mib_set_confirm Sergio Paracuellos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1523874572-25171-3-git-send-email-sergio.paracuellos@gmail.com \
    --to=sergio.paracuellos@gmail.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.