Linux wireless drivers development
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>,
	Hauke Mehrtens <hauke@hauke-m.de>
Subject: Re: [PATCH V4] bcma: use custom printing functions
Date: Sat, 30 Jun 2012 15:18:41 -0700	[thread overview]
Message-ID: <1341094721.10603.4.camel@joe2Laptop> (raw)
In-Reply-To: <1341087486-14159-1-git-send-email-zajec5@gmail.com>

On Sat, 2012-06-30 at 22:18 +0200, Rafał Miłecki wrote:
> Having bus number printed makes it much easier to anaylze logs on
> systems with more buses. For example Netgear WNDR4500 has 3 AMBA buses
> in total, which makes standard log really messy.
[]
> V4: replace some pr_debug I missed in V3
> 
> Unfortunately, bcma_debug is not complete in case of
> CONFIG_DYNAMIC_DEBUG. It'd be great if someone could help with that...
[]
> diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
[]
> @@ -10,6 +10,26 @@
>  
>  #define BCMA_CORE_SIZE		0x1000
>  
> +/* We use pr_fmt, so call printk directly */
> +#define bcma_err(bus, fmt, ...) \
> +	printk(KERN_ERR KBUILD_MODNAME " bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
> +#define bcma_warn(bus, fmt, ...) \
> +	printk(KERN_WARNING KBUILD_MODNAME " bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
> +#define bcma_info(bus, fmt, ...) \
> +	printk(KERN_INFO KBUILD_MODNAME " bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
> +
> +#if defined(CONFIG_DYNAMIC_DEBUG)
> +/* FIXME: include bus num */
> +#define bcma_debug(bus, fmt, ...) \
> +	pr_debug(fmt, ##__VA_ARGS__)
> +#elif defined(DEBUG)
> +#define bcma_debug(bus, fmt, ...) \
> +	printk(KERN_DEBUG KBUILD_MODNAME " bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
> +#else
> +#define bcma_debug(bus, fmt, ...) \
> +	no_printk(KERN_DEBUG KBUILD_MODNAME " bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
> +#endif

Well, my suggestion would be to use a standardized
"bcma: bus%d: " prefix and change these to:

#define bcma_err(bus, fmt, ...) \
	pr_err("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
#define bcma_warn(bus, fmt, ...) \
	pr_warn("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
#define bcma_info(bus, fmt, ...) \
	pr_info("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
#define bcma_debug(bus, fmt, ...) \
	pr_debug("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
 


      reply	other threads:[~2012-06-30 22:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-30 20:18 [PATCH V4] bcma: use custom printing functions Rafał Miłecki
2012-06-30 22:18 ` Joe Perches [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=1341094721.10603.4.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=hauke@hauke-m.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --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