linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: David Herrmann <dh.herrmann@googlemail.com>
Cc: linux-input@vger.kernel.org
Subject: [PATCH 3/4] Input: mousedev - rename mixdev_open to opened_by_mixdev
Date: Wed,  3 Oct 2012 14:03:01 -0700	[thread overview]
Message-ID: <1349298182-22452-3-git-send-email-dmitry.torokhov@gmail.com> (raw)
In-Reply-To: <1349298182-22452-1-git-send-email-dmitry.torokhov@gmail.com>

Do the rename to make the logic more clear and also change it to bool
while at it.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
 drivers/input/mousedev.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index 91f6220..2baf32d 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -68,7 +68,7 @@ struct mousedev {
 	bool exist;
 
 	struct list_head mixdev_node;
-	int mixdev_open;
+	bool opened_by_mixdev;
 
 	struct mousedev_hw_data packet;
 	unsigned int pkt_count;
@@ -469,11 +469,11 @@ static void mixdev_open_devices(void)
 		return;
 
 	list_for_each_entry(mousedev, &mousedev_mix_list, mixdev_node) {
-		if (!mousedev->mixdev_open) {
+		if (!mousedev->opened_by_mixdev) {
 			if (mousedev_open_device(mousedev))
 				continue;
 
-			mousedev->mixdev_open = 1;
+			mousedev->opened_by_mixdev = true;
 		}
 	}
 }
@@ -491,8 +491,8 @@ static void mixdev_close_devices(void)
 		return;
 
 	list_for_each_entry(mousedev, &mousedev_mix_list, mixdev_node) {
-		if (mousedev->mixdev_open) {
-			mousedev->mixdev_open = 0;
+		if (mousedev->opened_by_mixdev) {
+			mousedev->opened_by_mixdev = false;
 			mousedev_close_device(mousedev);
 		}
 	}
@@ -935,7 +935,7 @@ static int mixdev_add_device(struct mousedev *mousedev)
 		if (retval)
 			goto out;
 
-		mousedev->mixdev_open = 1;
+		mousedev->opened_by_mixdev = true;
 	}
 
 	get_device(&mousedev->dev);
@@ -950,8 +950,8 @@ static void mixdev_remove_device(struct mousedev *mousedev)
 {
 	mutex_lock(&mousedev_mix->mutex);
 
-	if (mousedev->mixdev_open) {
-		mousedev->mixdev_open = 0;
+	if (mousedev->opened_by_mixdev) {
+		mousedev->opened_by_mixdev = false;
 		mousedev_close_device(mousedev);
 	}
 
-- 
1.7.11.4


  parent reply	other threads:[~2012-10-03 21:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-03 21:02 [PATCH 1/4] Input: mousedev - factor out psaux code to reduce #ifdefery Dmitry Torokhov
2012-10-03 21:03 ` [PATCH 2/4] Input: mousedev - reformat structure initializers Dmitry Torokhov
2012-10-03 21:03 ` Dmitry Torokhov [this message]
2012-10-03 21:03 ` [PATCH 4/4] Input: extend the number of event (and other) devices Dmitry Torokhov
2012-10-07 14:52   ` David Herrmann
2012-10-10 16:58     ` Dmitry Torokhov
2012-10-07 14:56   ` David Herrmann

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=1349298182-22452-3-git-send-email-dmitry.torokhov@gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=dh.herrmann@googlemail.com \
    --cc=linux-input@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).