public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: Daniel Borkmann <dborkman@redhat.com>,
	linux-sctp@vger.kernel.org, Vlad Yasevich <vyasevich@gmail.com>,
	David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] SCTP: Reduce log spamming for sctp setsockopt
Date: Mon, 16 Dec 2013 09:17:27 -0800	[thread overview]
Message-ID: <1387214247.18217.49.camel@joe-AO722> (raw)
In-Reply-To: <20131216170254.GF19809@hmsreliant.think-freely.org>

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

  reply	other threads:[~2013-12-16 17:17 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16 14:44 [PATCH] SCTP: Reduce log spamming for sctp setsockopt Neil Horman
2013-12-16 15:03 ` Joe Perches
2013-12-16 15:13   ` Daniel Borkmann
2013-12-16 15:21     ` Joe Perches
2013-12-16 15:45       ` Daniel Borkmann
2013-12-16 16:04         ` Neil Horman
2013-12-16 16:50           ` Joe Perches
2013-12-16 17:02             ` Neil Horman
2013-12-16 17:17               ` Joe Perches [this message]
2013-12-16 17:04             ` Daniel Borkmann
2013-12-16 15:24 ` David Laight
2013-12-16 15:44   ` Neil Horman
2013-12-16 17:06 ` [PATCH v2 0/2] sctp: Consolidate and ratelimit deprecation warnings Neil Horman
2013-12-16 17:06   ` [PATCH v2 2/2] SCTP: Reduce log spamming for sctp setsockopt Neil Horman
2013-12-17 16:19 ` [PATCH v3 0/2] sctp: Consolidate and ratelimit deprecation warnings Neil Horman
2013-12-17 16:19   ` [PATCH v3 2/2] SCTP: Reduce log spamming for sctp setsockopt Neil Horman
2013-12-22 22:56   ` [PATCH v3 0/2] sctp: Consolidate and ratelimit deprecation warnings David Miller
2013-12-23 13:19     ` Neil Horman
2013-12-23 13:29 ` [PATCH v4 " Neil Horman
2013-12-23 13:29   ` [PATCH v4 1/2] printk: Add a DEPRECATED macro Neil Horman
2013-12-23 13:29   ` [PATCH v4 2/2] SCTP: Reduce log spamming for sctp setsockopt Neil Horman
2013-12-23 22:55   ` [PATCH v4 0/2] sctp: Consolidate and ratelimit deprecation warnings Ben Hutchings
2013-12-24 13:37     ` Neil Horman
2013-12-31 19:00   ` David Miller
2013-12-31 20:08     ` Joe Perches
2014-01-02 14:31     ` Neil Horman

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=1387214247.18217.49.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=davem@davemloft.net \
    --cc=dborkman@redhat.com \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=vyasevich@gmail.com \
    /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