On 2017-02-02 13:16, Rafał Miłecki wrote: > From: Rafał Miłecki <rafal@xxxxxxxxxx> > > 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@xxxxxxxxxx> > --- > .../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