From: Joe Perches <joe@perches.com>
To: Devendra Naga <devendra.aaru@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Eric Dumazet <eric.dumazet@gmail.com>,
Kevin McKinney <klmckinney1@gmail.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3] [staging] bcm: Replace the BCM_DEBUG_* and BCM_SHOW_* macros with functions
Date: Tue, 29 May 2012 06:45:04 -0700 [thread overview]
Message-ID: <1338299104.2202.34.camel@joe2Laptop> (raw)
In-Reply-To: <1338289626-9021-1-git-send-email-devendra.aaru@gmail.com>
On Tue, 2012-05-29 at 16:37 +0530, Devendra Naga wrote:
[]
> diff --git a/drivers/staging/bcm/Debug.c b/drivers/staging/bcm/Debug.c
[]
> +void bcm_debug_print(PMINI_ADAPTER Adapter, int Type, int SubType,
> + int dbg_level, const char *fmt, ...)
> +{
> + struct va_format vaf;
> + va_list args;
> + UINT debug_level = Adapter->stDebugState.debug_level;
> +
> + va_start(args, fmt);
> +
> + vaf.fmt = fmt;
> + vaf.va = &args;
> +
> + if (DBG_TYPE_PRINTK == Type)
> + pr_info("%s: %pV", __func__, &vaf);
func
> + else if (Adapter &&
> + (dbg_level & DBG_LVL_BITMASK) <= debug_level &&
> + (Type & Adapter->stDebugState.type) &&
> + (SubType & Adapter->stDebugState.subtype[Type])) {
> + if (dbg_level & DBG_NO_FUNC_PRINT)
> + printk(KERN_DEBUG "%pV" , &vaf);
> + else
> + printk(KERN_DEBUG "%s: %pV", __func__, &vaf);
func
> + }
> +
> + va_end(args);
> +}
> +
> +void bcm_debug_print_buffer(PMINI_ADAPTER Adapter, int Type, int SubType,
> + int dbg_level, const void *buffer, size_t bufferlen)
> +{
> + if (DBG_TYPE_PRINTK == Type ||
> + (Adapter &&
> + (dbg_level & DBG_LVL_BITMASK) <= Adapter->stDebugState.debug_level &&
> + (Type & Adapter->stDebugState.type) &&
> + (SubType & Adapter->stDebugState.subtype[Type]))) {
> + printk(KERN_DEBUG "%s:\n", __func__);
func
> + print_hex_dump(KERN_DEBUG, " ", DUMP_PREFIX_OFFSET,
> + 16, 1, buffer, bufferlen, false);
> + }
> +}
[]
> diff --git a/drivers/staging/bcm/Debug.h b/drivers/staging/bcm/Debug.h
[]
> +struct _MINI_ADAPTER;
> +
> +__printf(5, 6)
> +
> +void bcm_debug_print(struct _MINI_ADAPTER *Adapter, int Type, int SubType,
> + int dbg_level, const char *fmt, ...);
No blank line between __printf and prototype
> +void bcm_debug_print_buffer(struct _MINI_ADAPTER *Adapter, int Type, int SubType,
> + int dbg_level, const void *buffer, size_t bufferlen);
> +void bcm_show_debug_bitmap(struct _MINI_ADAPTER *Adapter);
> +
> +#define BCM_DEBUG_PRINT(Adapter, Type, SubType, dbg_level, fmt, ...) \
> + bcm_debug_print(Adapter, Type, SubType, dbg_level, fmt, ##__VA_ARGS__)
> +
> +#define BCM_DEBUG_PRINT_BUFFER(Adapter, Type, SubType, dbg_level, \
> + buffer, bufferlen) \
> + bcm_debug_print_buffer(Adapter, Type, SubType, dbg_level, \
> + buffer, bufferlen)
> +#define BCM_SHOW_DEBUG_BITMAP(Adapter) \
> + bcm_show_debug_bitmap(Adapter)
Turns out to keep the same behavior, you need to add
a const char *func argument to these functions and
change the macros to pass __func__.
next prev parent reply other threads:[~2012-05-29 13:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-29 11:07 [PATCH V3] [staging] bcm: Replace the BCM_DEBUG_* and BCM_SHOW_* macros with functions Devendra Naga
2012-05-29 13:45 ` Joe Perches [this message]
2012-05-29 15:20 ` devendra.aaru
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=1338299104.2202.34.camel@joe2Laptop \
--to=joe@perches.com \
--cc=devel@driverdev.osuosl.org \
--cc=devendra.aaru@gmail.com \
--cc=eric.dumazet@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=klmckinney1@gmail.com \
--cc=linux-kernel@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