struct ath5k_hw *ah = sc->ah;
        ath5k_hw_set_opmode(ah, sc->opmode);
        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");
+                 sc->opmode, ath_opmode_to_string(sc->opmode));
 }
 
 void ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc,
 
        char buf[700];
        unsigned int len = 0;
        u32 filt = ath5k_hw_get_rx_filter(sc->ah);
-       const char *tmp;
 
        len += snprintf(buf+len, sizeof(buf)-len, "bssid-mask: %pM\n",
                        sc->bssidmask);
        if (filt & AR5K_RX_FILTER_PHYERR_5211)
                snprintf(buf+len, sizeof(buf)-len, " PHYERR-5211");
        if (filt & AR5K_RX_FILTER_RADARERR_5211)
-               len += snprintf(buf+len, sizeof(buf)-len, " RADARERR-5211\n");
-       else
-               len += snprintf(buf+len, sizeof(buf)-len, "\n");
-
-       tmp = ath_opmode_to_string(sc->opmode);
-       if (tmp)
-               len += snprintf(buf+len, sizeof(buf)-len, "opmode: %s\n",
-                               tmp);
-       else
-               len += snprintf(buf+len, sizeof(buf)-len,
-                               "opmode: UNKNOWN-%i\n", sc->opmode);
+               len += snprintf(buf+len, sizeof(buf)-len, " RADARERR-5211");
+
+       len += snprintf(buf+len, sizeof(buf)-len, "\nopmode: %s (%d)\n",
+                       ath_opmode_to_string(sc->opmode), sc->opmode);
 
        if (len > sizeof(buf))
                len = sizeof(buf);
 
 #endif /* CONFIG_ATH_DEBUG */
 
 /** Returns string describing opmode, or NULL if unknown mode. */
+#ifdef CONFIG_ATH_DEBUG
 const char *ath_opmode_to_string(enum nl80211_iftype opmode);
+#else
+static inline const char *ath_opmode_to_string(enum nl80211_iftype opmode)
+{
+       return "UNKNOWN";
+}
+#endif
 
 #endif /* ATH_DEBUG_H */