public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Samuel Ortiz <sameo@linux.intel.com>
Cc: linux-kernel@vger.kernel.org,
	Lars-Peter Clausen <lars@metafoo.de>,
	Balaji Rao <balajirrao@openmoko.org>
Subject: [PATCH 1/5] mfd: pcf50633 - make 'is_suspended' a bool
Date: Sun, 15 Nov 2009 22:08:43 -0800	[thread overview]
Message-ID: <20091116060843.20162.17883.stgit@localhost.localdomain> (raw)
In-Reply-To: <20091116060611.20162.81714.stgit@localhost.localdomain>

The field holds boolean data and should be typed as such. Also annotate
check for is_spspended in IRQ handler with 'unlikely'.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/mfd/pcf50633-core.c       |    6 +++---
 include/linux/mfd/pcf50633/core.h |    3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
index 03dcc92..fb44e4d 100644
--- a/drivers/mfd/pcf50633-core.c
+++ b/drivers/mfd/pcf50633-core.c
@@ -412,8 +412,8 @@ static void pcf50633_irq_worker(struct work_struct *work)
 	}
 
 	/* Have we just resumed ? */
-	if (pcf->is_suspended) {
-		pcf->is_suspended = 0;
+	if (unlikely(pcf->is_suspended)) {
+		pcf->is_suspended = false;
 
 		/* Set the resume reason filtering out non resumers */
 		for (i = 0; i < ARRAY_SIZE(pcf_int); i++)
@@ -510,7 +510,7 @@ static int pcf50633_suspend(struct i2c_client *client, pm_message_t state)
 		goto out;
 	}
 
-	pcf->is_suspended = 1;
+	pcf->is_suspended = true;
 
 out:
 	return ret;
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h
index d9034cc..43bb2ac 100644
--- a/include/linux/mfd/pcf50633/core.h
+++ b/include/linux/mfd/pcf50633/core.h
@@ -13,6 +13,7 @@
 #ifndef __LINUX_MFD_PCF50633_CORE_H
 #define __LINUX_MFD_PCF50633_CORE_H
 
+#include <linux/types.h>
 #include <linux/i2c.h>
 #include <linux/workqueue.h>
 #include <linux/regulator/driver.h>
@@ -139,7 +140,7 @@ struct pcf50633 {
 
 	u8 suspend_irq_masks[5];
 	u8 resume_reason[5];
-	int is_suspended;
+	bool is_suspended;
 
 	int onkey1s_held;
 


  reply	other threads:[~2009-11-16  6:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-16  6:08 [PATCH 0/5] pcf50633 - error handling & use threaded IRQs - v2 Dmitry Torokhov
2009-11-16  6:08 ` Dmitry Torokhov [this message]
2009-11-16  6:08 ` [PATCH 2/5] mfd: pcf50633 - use threaded interrupts Dmitry Torokhov
2009-11-16  6:08 ` [PATCH 3/5] mfd: pcf50633 - move creating of regulator devices out of line Dmitry Torokhov
2009-11-16  6:08 ` [PATCH 4/5] mfd: pcf50633 - fix error handling during probe Dmitry Torokhov
2009-11-16  6:09 ` [PATCH 5/5] mfd: pcf50633 - whitespace and formatting fixes Dmitry Torokhov
2009-11-20  9:45 ` [PATCH 0/5] pcf50633 - error handling & use threaded IRQs - v2 Samuel Ortiz
2010-05-07 21:38   ` Lars-Peter Clausen

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=20091116060843.20162.17883.stgit@localhost.localdomain \
    --to=dmitry.torokhov@gmail.com \
    --cc=balajirrao@openmoko.org \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    /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