diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-04-16 17:20:06 +0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-04-16 17:20:06 +0400 |
commit | cf0dbba515415bb19b11f9323d5f7bebd7f24fd6 (patch) | |
tree | 375bbc1ade1a92acd6493d224dd701fd7f209014 /lib/ratelimit.c | |
parent | 1cff399ecd9125d8e6a634a1957be1aeb3195a12 (diff) | |
parent | 0340c7dccd80d8706c636e030a6ebbddbddca690 (diff) | |
download | linux-cf0dbba515415bb19b11f9323d5f7bebd7f24fd6.tar.xz |
Merge remote branch 'alsa/devel' into topic/misc
Diffstat (limited to 'lib/ratelimit.c')
-rw-r--r-- | lib/ratelimit.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/ratelimit.c b/lib/ratelimit.c index 09f5ce1810dc..027a03f4c56d 100644 --- a/lib/ratelimit.c +++ b/lib/ratelimit.c @@ -16,9 +16,14 @@ /* * __ratelimit - rate limiting * @rs: ratelimit_state data + * @func: name of calling function * - * This enforces a rate limit: not more than @rs->ratelimit_burst callbacks - * in every @rs->ratelimit_jiffies + * This enforces a rate limit: not more than @rs->burst callbacks + * in every @rs->interval + * + * RETURNS: + * 0 means callbacks will be suppressed. + * 1 means go ahead and do it. */ int ___ratelimit(struct ratelimit_state *rs, const char *func) { @@ -35,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; |