Joe Perches wrote: > Perhaps: > static const char * const offchannel_state[] = {... > > It is typically is an unsafe practice to > index an char * array with an enum. > > It might be safer to use a lookup function > (and smaller when ath_dbg is not enabled) > > Something like: > > static const char *offchannel_state_string(enum ath_offchannel_state state) > { > #define case_rtn_string(val) case val: return #val > switch (state) { > case_rtn_string(ATH_OFFCHANNEL_IDLE); > case_rtn_string(ATH_OFFCHANNEL_PROBE_SEND); > case_rtn_string(ATH_OFFCHANNEL_PROBE_WAIT); > case_rtn_string(ATH_OFFCHANNEL_SUSPEND); > case_rtn_string(ATH_OFFCHANNEL_ROC_START); > case_rtn_string(ATH_OFFCHANNEL_ROC_WAIT); > case_rtn_string(ATH_OFFCHANNEL_ROC_DONE); > default: > return "unknown"; > } > } This looks better, I'll send a v2. Thanks for the review. Sujith -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html