From: Joe Perches <joe@perches.com>
To: Adrian Chadd <adrian@freebsd.org>
Cc: Jiri Slaby <jirislaby@gmail.com>,
Nick Kossifidis <mickflemm@gmail.com>,
"Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>,
Bob Copeland <me@bobcopeland.com>,
"John W. Linville" <linville@tuxdriver.com>,
linux-wireless@vger.kernel.org, ath5k-devel@lists.ath5k.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH wireless-next 2/3] ath5k: Introduce _ath5k_printk to reduce code/text
Date: Sun, 18 Mar 2012 22:18:56 -0700 [thread overview]
Message-ID: <1332134336.23125.60.camel@joe2Laptop> (raw)
In-Reply-To: <CAJ-Vmo=ceSV38vQGfs8cKJScWjYF4kbQdK3+JJvQLCmnURaEwA@mail.gmail.com>
On Sun, 2012-03-18 at 21:36 -0700, Adrian Chadd wrote:
> Hi,
Hi Adrian.
> So the reason this is a macro in the FreeBSD HAL is so that the args
> aren't evaluated unless the level (or debug bitmap in my case) fires
> off.
>
> Otherwise compiling in debugging will cause a _lot_ of spurious
> register reads to occur that are then tossed. This was one of the big
> reasons for instability and slow performance when AH_DEBUG was
> enabled.
That doesn't make any sense in this case.
It's either a call to printk or _ath5_printk
but it's still a call to a function.
+void __printf(3, 4)
+_ath5k_printk(const struct ath5k_hw *ah, const char *level,
+ const char *fmt, ...);
+
#define ATH5K_PRINTK(_sc, _level, _fmt, ...) \
- printk(_level pr_fmt("%s%s" _fmt), \
- ((_sc) && (_sc)->hw) ? wiphy_name((_sc)->hw->wiphy) : "", \
- ((_sc) && (_sc)->hw) ? ": " : "", \
- ##__VA_ARGS__)
+ _ath5k_printk(_sc, _level, _fmt, ##__VA_ARGS__)
If there are level/mask tests to macros that
are used to call ATH5K_PRINTK, that still
works. As far as I can tell, there aren't
any uses of macros like that.
cheers, Joe
next prev parent reply other threads:[~2012-03-19 5:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-19 0:30 [PATCH wireless-next 0/3] ath: printk cleanups and code reduction Joe Perches
2012-03-19 0:30 ` [PATCH wireless-next 1/3] ath: Add and use pr_fmt, convert printks to pr_<level> Joe Perches
2012-03-19 0:30 ` [PATCH wireless-next 2/3] ath5k: Introduce _ath5k_printk to reduce code/text Joe Perches
2012-03-19 4:36 ` Adrian Chadd
2012-03-19 5:18 ` Joe Perches [this message]
2012-03-20 3:39 ` Adrian Chadd
[not found] ` <CAJ-Vmom4n7Sk5P=HMb+Z-FNyfyk87Xbf5Q1kPA4i2eXwQ72kXQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-20 3:48 ` Joe Perches
2012-03-19 0:30 ` [PATCH wireless-next 3/3] ath6kl: Add __printf verification to ath6kl_printk Joe Perches
2012-03-20 10:06 ` Kalle Valo
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=1332134336.23125.60.camel@joe2Laptop \
--to=joe@perches.com \
--cc=adrian@freebsd.org \
--cc=ath5k-devel@lists.ath5k.org \
--cc=jirislaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=mcgrof@qca.qualcomm.com \
--cc=me@bobcopeland.com \
--cc=mickflemm@gmail.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;
as well as URLs for NNTP newsgroup(s).