From: Yong Zhang <yong.zhang@windriver.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@elte.hu
Subject: [PATCH 1/3] ratelimit: annotate ___ratelimit()
Date: Wed, 17 Mar 2010 10:58:42 +0800 [thread overview]
Message-ID: <1268794724-8665-2-git-send-email-yong.zhang@windriver.com> (raw)
In-Reply-To: <1268794724-8665-1-git-send-email-yong.zhang@windriver.com>
Especially to prevent from wrong using of the return value.
Signed-off-by: Yong Zhang <yong.zhang@windriver.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Dave Young <hidave.darkstar@gmail.com>
---
lib/ratelimit.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/lib/ratelimit.c b/lib/ratelimit.c
index 09f5ce1..29a10b3 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 suppuressed.
+ * 1 means go ahead and do it.
*/
int ___ratelimit(struct ratelimit_state *rs, const char *func)
{
--
1.6.3.3
next prev parent reply other threads:[~2010-03-17 2:59 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 ` Yong Zhang [this message]
2010-03-17 2:58 ` [PATCH 2/3] kernel.h: fix wrong usage " 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
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=1268794724-8665-2-git-send-email-yong.zhang@windriver.com \
--to=yong.zhang@windriver.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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
all inboxes | Powered by JetHome®