Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ath5k: fix build break from "ath5k: Print out opmode in debugfs"

Also improve ath_opmode_to_string usage by having it return UNKNOWN
rather than NULL in the event of failure to map the opmode value to a
representative string.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Joe Perches and committed by
John W. Linville
908ebfb9 cfd8e12f

+12 -15
+1 -3
drivers/net/wireless/ath/ath5k/base.c
··· 563 563 struct ath5k_hw *ah = sc->ah; 564 564 ath5k_hw_set_opmode(ah, sc->opmode); 565 565 ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "mode setup opmode %d (%s)\n", 566 - sc->opmode, 567 - ath_opmode_to_string(sc->opmode) ? 568 - ath_opmode_to_string(sc->opmode) : "UKNOWN"); 566 + sc->opmode, ath_opmode_to_string(sc->opmode)); 569 567 } 570 568 571 569 void ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc,
+3 -11
drivers/net/wireless/ath/ath5k/debug.c
··· 493 493 char buf[700]; 494 494 unsigned int len = 0; 495 495 u32 filt = ath5k_hw_get_rx_filter(sc->ah); 496 - const char *tmp; 497 496 498 497 len += snprintf(buf+len, sizeof(buf)-len, "bssid-mask: %pM\n", 499 498 sc->bssidmask); ··· 521 522 if (filt & AR5K_RX_FILTER_PHYERR_5211) 522 523 snprintf(buf+len, sizeof(buf)-len, " PHYERR-5211"); 523 524 if (filt & AR5K_RX_FILTER_RADARERR_5211) 524 - len += snprintf(buf+len, sizeof(buf)-len, " RADARERR-5211\n"); 525 - else 526 - len += snprintf(buf+len, sizeof(buf)-len, "\n"); 525 + len += snprintf(buf+len, sizeof(buf)-len, " RADARERR-5211"); 527 526 528 - tmp = ath_opmode_to_string(sc->opmode); 529 - if (tmp) 530 - len += snprintf(buf+len, sizeof(buf)-len, "opmode: %s\n", 531 - tmp); 532 - else 533 - len += snprintf(buf+len, sizeof(buf)-len, 534 - "opmode: UNKNOWN-%i\n", sc->opmode); 527 + len += snprintf(buf+len, sizeof(buf)-len, "\nopmode: %s (%d)\n", 528 + ath_opmode_to_string(sc->opmode), sc->opmode); 535 529 536 530 if (len > sizeof(buf)) 537 531 len = sizeof(buf);
+1 -1
drivers/net/wireless/ath/debug.c
··· 55 55 case NL80211_IFTYPE_P2P_GO: 56 56 return "P2P-GO"; 57 57 default: 58 - return NULL; 58 + return "UNKNOWN"; 59 59 } 60 60 } 61 61 EXPORT_SYMBOL(ath_opmode_to_string);
+7
drivers/net/wireless/ath/debug.h
··· 78 78 #endif /* CONFIG_ATH_DEBUG */ 79 79 80 80 /** Returns string describing opmode, or NULL if unknown mode. */ 81 + #ifdef CONFIG_ATH_DEBUG 81 82 const char *ath_opmode_to_string(enum nl80211_iftype opmode); 83 + #else 84 + static inline const char *ath_opmode_to_string(enum nl80211_iftype opmode) 85 + { 86 + return "UNKNOWN"; 87 + } 88 + #endif 82 89 83 90 #endif /* ATH_DEBUG_H */