Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755214Ab1FCXOU (ORCPT ); Fri, 3 Jun 2011 19:14:20 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:48767 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754247Ab1FCXOT (ORCPT ); Fri, 3 Jun 2011 19:14:19 -0400 Date: Fri, 3 Jun 2011 16:14:15 -0700 From: Andrew Morton To: Christian Gmeiner Cc: linux-kernel@vger.kernel.org, Andres Salomon Subject: Re: [PATCH] cs5535 mfgpt - fix wrong if condition Message-Id: <20110603161415.49031357.akpm@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1588 Lines: 43 On Wed, 25 May 2011 19:08:06 +0000 Christian Gmeiner wrote: > From: Christian Gmeiner > > 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 > --- > 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; > } > What were the runtime effects of this bug? (Please always include this information in the changelog when fixing things) Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/