Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334562
b: refs/heads/master
c: 2351a6c
h: refs/heads/master
v: v3
  • Loading branch information
Markus Trippelsdorf authored and Greg Kroah-Hartman committed Oct 5, 2012
1 parent 5610b66 commit 5c8162a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6f5601251d7e306b8a7bf5e674c5307d865c0fa1
refs/heads/master: 2351a6c6e7d5a5e848411b5dd2c02142497624cc
27 changes: 9 additions & 18 deletions trunk/include/linux/ratelimit.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,36 +46,27 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
#define WARN_ON_RATELIMIT(condition, state) \
WARN_ON((condition) && __ratelimit(state))

#define __WARN_RATELIMIT(condition, state, format...) \
({ \
int rtn = 0; \
if (unlikely(__ratelimit(state))) \
rtn = WARN(condition, format); \
rtn; \
})

#define WARN_RATELIMIT(condition, format...) \
#define WARN_RATELIMIT(condition, format, ...) \
({ \
static DEFINE_RATELIMIT_STATE(_rs, \
DEFAULT_RATELIMIT_INTERVAL, \
DEFAULT_RATELIMIT_BURST); \
__WARN_RATELIMIT(condition, &_rs, format); \
int rtn = !!(condition); \
\
if (unlikely(rtn && __ratelimit(&_rs))) \
WARN(rtn, format, ##__VA_ARGS__); \
\
rtn; \
})

#else

#define WARN_ON_RATELIMIT(condition, state) \
WARN_ON(condition)

#define __WARN_RATELIMIT(condition, state, format...) \
({ \
int rtn = WARN(condition, format); \
rtn; \
})

#define WARN_RATELIMIT(condition, format...) \
#define WARN_RATELIMIT(condition, format, ...) \
({ \
int rtn = WARN(condition, format); \
int rtn = WARN(condition, format, ##__VA_ARGS__); \
rtn; \
})

Expand Down

0 comments on commit 5c8162a

Please sign in to comment.