mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "John W. Linville" <linville@tuxdriver.com>
To: linux-wireless@vger.kernel.org
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	Ben Greear <greearb@candelatech.com>,
	linux-kernel@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>
Subject: [PATCH] ath5k: fix build break from "ath5k: Print out opmode in debugfs"
Date: Tue, 12 Oct 2010 10:53:26 -0400	[thread overview]
Message-ID: <1286895206-3030-1-git-send-email-linville@tuxdriver.com> (raw)
In-Reply-To: <20101012163519.a88f2040.sfr@canb.auug.org.au>

Without this and with CONFIG_ATH_DEBUG not set...

ERROR: ".ath_opmode_to_string" [drivers/net/wireless/ath/ath5k/ath5k.ko] undefined!

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
Please don't make me commit such an ugly patch...

 drivers/net/wireless/ath/ath5k/base.c  |    4 ++++
 drivers/net/wireless/ath/ath5k/debug.c |    6 +++++-
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index c9732a6..b839a6b 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -562,10 +562,14 @@ static void ath_do_set_opmode(struct ath5k_softc *sc)
 {
 	struct ath5k_hw *ah = sc->ah;
 	ath5k_hw_set_opmode(ah, sc->opmode);
+#ifdef CONFIG_ATH_DEBUG
 	ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "mode setup opmode %d (%s)\n",
 		  sc->opmode,
 		  ath_opmode_to_string(sc->opmode) ?
 		  ath_opmode_to_string(sc->opmode) : "UKNOWN");
+#else
+	ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "mode setup opmode %d\n", sc->opmode);
+#endif
 }
 
 void ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc,
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index a3b2171..329187a 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -493,7 +493,7 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
 	char buf[700];
 	unsigned int len = 0;
 	u32 filt = ath5k_hw_get_rx_filter(sc->ah);
-	const char *tmp;
+	const char *tmp __maybe_unused;
 
 	len += snprintf(buf+len, sizeof(buf)-len, "bssid-mask: %pM\n",
 			sc->bssidmask);
@@ -526,6 +526,7 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
 	else
 		len += snprintf(buf+len, sizeof(buf)-len, "\n");
 
+#ifdef CONFIG_ATH_DEBUG
 	tmp = ath_opmode_to_string(sc->opmode);
 	if (tmp)
 		len += snprintf(buf+len, sizeof(buf)-len, "opmode: %s\n",
@@ -533,6 +534,9 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
 	else
 		len += snprintf(buf+len, sizeof(buf)-len,
 				"opmode: UNKNOWN-%i\n", sc->opmode);
+#else
+	len += snprintf(buf+len, sizeof(buf)-len, "opmode: %i\n", sc->opmode);
+#endif
 
 	if (len > sizeof(buf))
 		len = sizeof(buf);
-- 
1.7.2.3


  reply	other threads:[~2010-10-12 15:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-12  5:35 linux-next: build failure after merge of the final tree (wireless tree related) Stephen Rothwell
2010-10-12 14:53 ` John W. Linville [this message]
2010-10-12 15:43   ` [PATCH] ath5k: fix build break from "ath5k: Print out opmode in debugfs" Joe Perches
2010-10-12 17:15     ` John W. Linville
2010-10-12 16:54   ` Bob Copeland
2010-10-12 17:42     ` Bob Copeland
2010-10-12 18:07       ` Joe Perches
2010-10-12 18:13   ` Linus Torvalds
2010-10-12 18:18     ` John W. Linville
2010-10-12 23:31       ` Ben Greear

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=1286895206-3030-1-git-send-email-linville@tuxdriver.com \
    --to=linville@tuxdriver.com \
    --cc=greearb@candelatech.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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

all inboxes | Powered by JetHome®