[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1387214247.18217.49.camel@joe-AO722>
Date: Mon, 16 Dec 2013 09:17:27 -0800
From: Joe Perches <joe@...ches.com>
To: Neil Horman <nhorman@...driver.com>
Cc: Daniel Borkmann <dborkman@...hat.com>, linux-sctp@...r.kernel.org,
Vlad Yasevich <vyasevich@...il.com>,
David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH] SCTP: Reduce log spamming for sctp setsockopt
On Mon, 2013-12-16 at 12:02 -0500, Neil Horman wrote:
> On Mon, Dec 16, 2013 at 08:50:35AM -0800, Joe Perches wrote:
[]
> > Does adding a couple of functions like:
> >
> > void pr_warn_deprecated(const char *old, const char *new)
> > {
> > static DEFINE_RATELIMIT_STATE(_rs,
> > DEFAULT_RATELIMIT_INTERVAL,
> > DEFAULT_RATELIMIT_BURST);
> >
> > if (!__ratelimit(&_rs))
> > return;
> >
> > if (new)
> > printk(KERN_WARNING "%pf: Use of \"%s\" is deprecated - use \"%s\" instead\n",
> > __builtin_return_address(1), old, new);
> > else
> > printk(KERN_WARNING "%pf: Use of \"%s\" is deprecated\n",
> > __builtin_return_address(1), old);
> > }
> >
> > suit? Other suggestions?
> >
>
> i'm just doing this:
> #define pr_warn_deprecated(fmt, ...) \
> pr_warn_ratelimited("Deprecated: " fmt, ##__VA_ARGS__)
>
> That will work for every form, giving consistency to the location of a single
> word for ease of searching. I don't really see the need to institutionalize
> "use <blank> instead", since there may be no drop in replacement for something
> that is deprecated.
That's what the test for non-null "new" was for
but fine, it's your code.
Do what you think appropriate.
Also, using pr_warn_once may be better. Dunno.
cheers, Joe
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists