public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Yong Zhang <yong.zhang@windriver.com>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu
Subject: Re: [RFC PATCH 3/3] ratelimit: Fix return value when fail to get lock
Date: Mon, 22 Mar 2010 13:07:18 -0700	[thread overview]
Message-ID: <20100322130718.4b5bc6a2.akpm@linux-foundation.org> (raw)
In-Reply-To: <1268794724-8665-4-git-send-email-yong.zhang@windriver.com>

On Wed, 17 Mar 2010 10:58:44 +0800
Yong Zhang <yong.zhang@windriver.com> wrote:

> >From log of commit edaac8e3167501cda336231d00611bf59c164346,
> It seems that we want to suppress the callback when trylock
> fails.
> 
> Signed-off-by: Yong Zhang <yong.zhang@windriver.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  lib/ratelimit.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/lib/ratelimit.c b/lib/ratelimit.c
> index 29a10b3..358638f 100644
> --- a/lib/ratelimit.c
> +++ b/lib/ratelimit.c
> @@ -40,7 +40,7 @@ int ___ratelimit(struct ratelimit_state *rs, const char *func)
>  	 * the entity that is holding the lock already:
>  	 */
>  	if (!spin_trylock_irqsave(&rs->lock, flags))
> -		return 1;
> +		return 0;
>  
>  	if (!rs->begin)
>  		rs->begin = jiffies;

Looks right to me.  I queued all three patches for 2.6.34.

      reply	other threads:[~2010-03-22 20:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17  2:58 [PATCH 0/3] ratelimit: patchset focus on return value of __ratelimit() Yong Zhang
2010-03-17  2:58 ` [PATCH 1/3] ratelimit: annotate ___ratelimit() Yong Zhang
2010-03-17  2:58 ` [PATCH 2/3] kernel.h: fix wrong usage of __ratelimit() Yong Zhang
2010-03-17  2:58 ` [RFC PATCH 3/3] ratelimit: Fix return value when fail to get lock Yong Zhang
2010-03-22 20:07   ` Andrew Morton [this message]

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=20100322130718.4b5bc6a2.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=yong.zhang@windriver.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