[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121004131101.GA245@x4>
Date: Thu, 4 Oct 2012 15:11:01 +0200
From: Markus Trippelsdorf <markus@...ppelsdorf.de>
To: Borislav Petkov <bp@...64.org>
Cc: Jiri Slaby <jslaby@...e.cz>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: tty_init_dev: 24 callbacks suppressed
On 2012.10.04 at 14:40 +0200, Borislav Petkov wrote:
> On Thu, Oct 04, 2012 at 01:51:57PM +0200, Markus Trippelsdorf wrote:
> > diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
> > index e11ccb4..d8de255 100644
> > --- a/include/linux/ratelimit.h
> > +++ b/include/linux/ratelimit.h
> > @@ -46,20 +46,17 @@ 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, fmt, ...) \
> > ({ \
> > 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, fmt, ##__VA_ARGS__); \
> > + \
> > + rtn; \
> > })
>
> Aha, I see it. We need to look at the condition before the __ratelimit,
> otherwise we WARN unnecessarily, good catch.
>
> > #else
> > @@ -67,15 +64,9 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
> > #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, fmt, ...) \
>
> ... except this change is unrelated and unneeded - there's enough room
> in 80 cols to leave it as "format" instead of shortening it.
>
> Other than that:
>
> Acked-and-tested-by: Borislav Petkov <borislav.petkov@....com>
I'll let Jiri handle this :). It's his patch anyway.
--
Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists