From: Felix Fietkau <nbd@nbd.name>
To: "Rafał Miłecki" <zajec5@gmail.com>, "Kalle Valo" <kvalo@codeaurora.org>
Cc: "Arend van Spriel" <arend.vanspriel@broadcom.com>,
"Franky Lin" <franky.lin@broadcom.com>,
"Hante Meuleman" <hante.meuleman@broadcom.com>,
"Pieter-Paul Giesberts" <pieter-paul.giesberts@broadcom.com>,
"Franky Lin" <frankyl@broadcom.com>,
linux-wireless@vger.kernel.org,
brcm80211-dev-list.pdl@broadcom.com,
"Rafał Miłecki" <rafal@milecki.pl>
Subject: Re: [PATCH V2 1/7] brcmfmac: switch to C function (__brcmf_err) for printing errors
Date: Thu, 2 Feb 2017 13:46:18 +0100 [thread overview]
Message-ID: <6484b7bf-da37-04ec-8efd-825f44cc12d2@nbd.name> (raw)
In-Reply-To: <20170202121659.21130-1-zajec5@gmail.com>
On 2017-02-02 13:16, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
>
> This will allow extending code and using more detailed messages e.g.
> with the help of dev_err. Note that *two separated* brcmf_err macros
> were replaced thanks to using a simple CONFIG_BRCMDBG symbol check in
> the body.
>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
> .../net/wireless/broadcom/brcm80211/brcmfmac/common.c | 19 +++++++++++++++++++
> .../net/wireless/broadcom/brcm80211/brcmfmac/debug.h | 16 ----------------
> 2 files changed, 19 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
> index f7c8c2e80349..05fb778ddd0f 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
> @@ -218,6 +218,25 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
> return err;
> }
>
> +#ifndef CONFIG_BRCM_TRACING
> +void __brcmf_err(const char *func, const char *fmt, ...)
> +{
> + struct va_format vaf;
> + va_list args;
> +
> + if (!net_ratelimit() && !IS_ENABLED(CONFIG_BRCMDBG))
> + return;
The IS_ENABLED must not come after net_ratelimit, because net_ratelimit
has side effects.
Also, please keep the IS_ENABLED(CONFIG_BRCMDBG) check inline, since
it's a compile-time check, and that allows gcc to skip unnecessary calls
when disabled.
- Felix
prev parent reply other threads:[~2017-02-02 12:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-02 12:16 [PATCH V2 1/7] brcmfmac: switch to C function (__brcmf_err) for printing errors Rafał Miłecki
2017-02-02 12:16 ` [PATCH V2 2/7] brcmfmac: add struct brcmf_pub parameter to the __brcmf_err Rafał Miłecki
2017-02-02 12:16 ` [PATCH V2 3/7] brcmfmac: pcie: store private pointer to struct brcmf_pub Rafał Miłecki
2017-02-02 12:16 ` [PATCH V2 4/7] brcmfmac: usb: " Rafał Miłecki
2017-02-02 12:16 ` [PATCH V2 5/7] brcmfmac: sdio: " Rafał Miłecki
2017-02-02 12:16 ` [PATCH V2 6/7] brcmfmac: modify all brcmf_err calls adding " Rafał Miłecki
2017-02-02 12:16 ` [PATCH V2 7/7] brcmfmac: use dev_err to print errors Rafał Miłecki
2017-02-02 12:46 ` Felix Fietkau [this message]
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=6484b7bf-da37-04ec-8efd-825f44cc12d2@nbd.name \
--to=nbd@nbd.name \
--cc=arend.vanspriel@broadcom.com \
--cc=brcm80211-dev-list.pdl@broadcom.com \
--cc=franky.lin@broadcom.com \
--cc=frankyl@broadcom.com \
--cc=hante.meuleman@broadcom.com \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=pieter-paul.giesberts@broadcom.com \
--cc=rafal@milecki.pl \
--cc=zajec5@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