From: David Miller <davem@davemloft.net>
To: ecree@solarflare.com
Cc: linux-net-drivers@solarflare.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 2/3] sfc: refactor debug-or-warnings printks
Date: Thu, 26 Jan 2017 14:36:29 -0500 (EST) [thread overview]
Message-ID: <20170126.143629.337763461510725581.davem@davemloft.net> (raw)
In-Reply-To: <15f3ecb9-1785-8688-93b9-51d400ee12bc@solarflare.com>
From: Edward Cree <ecree@solarflare.com>
Date: Thu, 26 Jan 2017 17:53:48 +0000
> diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
> index 5927c20..c640955 100644
> --- a/drivers/net/ethernet/sfc/net_driver.h
> +++ b/drivers/net/ethernet/sfc/net_driver.h
> @@ -51,6 +51,15 @@
> #define EFX_WARN_ON_PARANOID(x) do {} while (0)
> #endif
>
> +/* if @cond then downgrade to debug, else print at @level */
> +#define netif_cond_dbg(priv, type, netdev, cond, level, fmt, args...) \
> + do { \
> + if (cond) \
> + netif_dbg(priv, type, netdev, fmt, ##args); \
> + else \
> + netif_ ## level(priv, type, netdev, fmt, ##args); \
> + } while (0)
> +
> /**************************************************************************
> *
> * Efx data structures
>
Please do not define locally in a driver an interface that looks like a generic
one and might be useful to code outside of your driver.
Thanks.
next prev parent reply other threads:[~2017-01-26 19:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-26 17:50 [PATCH net-next 0/3] sfc: encapsulated filters Edward Cree
2017-01-26 17:52 ` [PATCH net-next 1/3] sfc: fixes to filter restore handling Edward Cree
2017-01-26 17:53 ` [PATCH net-next 2/3] sfc: refactor debug-or-warnings printks Edward Cree
2017-01-26 19:36 ` David Miller [this message]
2017-01-27 11:34 ` Edward Cree
2017-01-26 17:54 ` [PATCH net-next 3/3] sfc: insert catch-all filters for encapsulated traffic Edward Cree
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=20170126.143629.337763461510725581.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=ecree@solarflare.com \
--cc=linux-net-drivers@solarflare.com \
--cc=netdev@vger.kernel.org \
/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