Linux wireless drivers development
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: linux-wireless@vger.kernel.org
Cc: ath6kl-devel@qualcomm.com
Subject: [PATCH 5/7] ath6kl: convert ath6kl_info/err/warn macros to real functions
Date: Thu, 27 Dec 2012 13:44:47 +0200	[thread overview]
Message-ID: <20121227114447.27069.54329.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20121227114156.27069.30223.stgit@localhost6.localdomain6>

After this it's cleaner to add trace calls. And besides, I prefer C over
CPP.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/debug.h |   53 +++++++++++++++++++++++++++----
 1 files changed, 47 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h
index f97cd4e..06f47f5 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.h
+++ b/drivers/net/wireless/ath/ath6kl/debug.h
@@ -52,12 +52,53 @@ extern unsigned int debug_mask;
 extern __printf(2, 3)
 int ath6kl_printk(const char *level, const char *fmt, ...);
 
-#define ath6kl_info(fmt, ...)				\
-	ath6kl_printk(KERN_INFO, fmt, ##__VA_ARGS__)
-#define ath6kl_err(fmt, ...)					\
-	ath6kl_printk(KERN_ERR, fmt, ##__VA_ARGS__)
-#define ath6kl_warn(fmt, ...)					\
-	ath6kl_printk(KERN_WARNING, fmt, ##__VA_ARGS__)
+static inline __printf(1,2) int ath6kl_info(const char *fmt, ...)
+{
+	struct va_format vaf = {
+		.fmt = fmt,
+	};
+	va_list args;
+	int ret;
+
+	va_start(args, fmt);
+	vaf.va = &args;
+	ret = ath6kl_printk(KERN_INFO, "%pV", &vaf);
+	va_end(args);
+
+	return ret;
+}
+
+static inline __printf(1,2) int ath6kl_err(const char *fmt, ...)
+{
+	struct va_format vaf = {
+		.fmt = fmt,
+	};
+	va_list args;
+	int ret;
+
+	va_start(args, fmt);
+	vaf.va = &args;
+	ret = ath6kl_printk(KERN_ERR, "%pV", &vaf);
+	va_end(args);
+
+	return ret;
+}
+
+static inline __printf(1,2) int ath6kl_warn(const char *fmt, ...)
+{
+	struct va_format vaf = {
+		.fmt = fmt,
+	};
+	va_list args;
+	int ret;
+
+	va_start(args, fmt);
+	vaf.va = &args;
+	ret = ath6kl_printk(KERN_WARNING, "%pV", &vaf);
+	va_end(args);
+
+	return ret;
+}
 
 enum ath6kl_war {
 	ATH6KL_WAR_INVALID_RATE,


  parent reply	other threads:[~2012-12-27 11:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-27 11:44 [PATCH 0/7] ath6kl: tracing support Kalle Valo
2012-12-27 11:44 ` [PATCH 1/7] ath6kl: add tracing support and tracing points for wmi packets Kalle Valo
2012-12-27 11:44 ` [PATCH 2/7] ath6kl: add tracing points for sdio transfers Kalle Valo
2012-12-27 12:13   ` Johannes Berg
2012-12-27 15:32     ` Kalle Valo
2012-12-27 11:44 ` [PATCH 3/7] ath6kl: add tracing point for hif irqs Kalle Valo
2012-12-27 11:44 ` [PATCH 4/7] ath6kl: adding tracing points for htc_mbox Kalle Valo
2012-12-27 11:44 ` Kalle Valo [this message]
2012-12-27 12:19   ` [PATCH 5/7] ath6kl: convert ath6kl_info/err/warn macros to real functions Johannes Berg
2012-12-27 15:47     ` Kalle Valo
2012-12-27 15:55       ` Kalle Valo
2012-12-27 11:44 ` [PATCH 6/7] ath6kl: add tracing support to log functions Kalle Valo
2012-12-27 11:44 ` [PATCH 7/7] ath6kl: add tracing support to debug message macros 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=20121227114447.27069.54329.stgit@localhost6.localdomain6 \
    --to=kvalo@qca.qualcomm.com \
    --cc=ath6kl-devel@qualcomm.com \
    --cc=linux-wireless@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