On Mon, 2014-02-10 at 12:09 +0100, Johannes Berg wrote: > On Wed, 2014-02-05 at 20:44 -0800, Joe Perches wrote: > > > Perhaps use a more common kernel style > > > > struct ieee80211_reason_descriptions { > > u16 code; > > const char * desc; > > } > > > > and enumerate the reason codes with #defines and use a > > macro to populate the descriptions > > > > #define IEEE80211_REASON_RESERVED 0 > > #define IEEE80211_REASON_UNSPECIFIED 1 [] > Isn't it more efficient to just let the compiler generate it with a big > switch() statement?
That'd be fine too. The benefit of the #defines is that you typically get an external .h file for the entries. Calvin's suggested code looked pretty fragile. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/