public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cs5535 mfgpt - fix wrong if condition
@ 2011-05-25 19:08 Christian Gmeiner
  2011-06-03 23:14 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Gmeiner @ 2011-05-25 19:08 UTC (permalink / raw)
  To: linux-kernel

From: Christian Gmeiner <christian.gmeiner@gmail.com>

This patch fixes the wrong if condition for the check if the
requested timer is available.

The bitmap avail is used to store if a timer is used already.
test_bit() is used to check if the requested timer is
available. If a bit in the avail bitmap is set it means that the
timer is available.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
---
 drivers/misc/cs5535-mfgpt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/misc/cs5535-mfgpt.c b/drivers/misc/cs5535-mfgpt.c
index e01e08c..bc685bf 100644
--- a/drivers/misc/cs5535-mfgpt.c
+++ b/drivers/misc/cs5535-mfgpt.c
@@ -174,7 +174,7 @@ struct cs5535_mfgpt_timer
*cs5535_mfgpt_alloc_timer(int timer_nr, int domain)
                timer_nr = t < max ? (int) t : -1;
        } else {
                /* check if the requested timer's available */
-               if (test_bit(timer_nr, mfgpt->avail))
+               if (!test_bit(timer_nr, mfgpt->avail))
                        timer_nr = -1;
        }

-- 
1.7.5.rc3

--
Christian Gmeiner, MSc

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-06-03 23:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-25 19:08 [PATCH] cs5535 mfgpt - fix wrong if condition Christian Gmeiner
2011-06-03 23:14 ` Andrew Morton
2011-06-03 23:24   ` Andres Salomon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox