iwlwifi: mvm: use designated initialization for some arrays
authorEliad Peller <eliad@wizery.com>
Tue, 16 Jul 2013 15:07:20 +0000 (18:07 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 6 Aug 2013 08:35:04 +0000 (10:35 +0200)
rs_ht_to_legacy and ant_toggle_lookup are arrays that
represent some state-machine. initialize them explicitly
with designated initialization to make them more clear
and avoid errors.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/iwlwifi/mvm/rs.c

index 940f39d4320124aaafa551de9754abc2554592e9..d680c891ce86c0f4cca8cbc99864d6008f662d8e 100644 (file)
 #define IWL_RATE_SCALE_FLUSH_INTVL   (3*HZ)
 
 static u8 rs_ht_to_legacy[] = {
-       IWL_RATE_6M_INDEX, IWL_RATE_6M_INDEX,
-       IWL_RATE_6M_INDEX, IWL_RATE_6M_INDEX,
-       IWL_RATE_6M_INDEX,
-       IWL_RATE_6M_INDEX, IWL_RATE_9M_INDEX,
-       IWL_RATE_12M_INDEX, IWL_RATE_18M_INDEX,
-       IWL_RATE_24M_INDEX, IWL_RATE_36M_INDEX,
-       IWL_RATE_48M_INDEX, IWL_RATE_54M_INDEX
+       [IWL_RATE_1M_INDEX] = IWL_RATE_6M_INDEX,
+       [IWL_RATE_2M_INDEX] = IWL_RATE_6M_INDEX,
+       [IWL_RATE_5M_INDEX] = IWL_RATE_6M_INDEX,
+       [IWL_RATE_11M_INDEX] = IWL_RATE_6M_INDEX,
+       [IWL_RATE_6M_INDEX] = IWL_RATE_6M_INDEX,
+       [IWL_RATE_9M_INDEX] = IWL_RATE_6M_INDEX,
+       [IWL_RATE_12M_INDEX] = IWL_RATE_9M_INDEX,
+       [IWL_RATE_18M_INDEX] = IWL_RATE_12M_INDEX,
+       [IWL_RATE_24M_INDEX] = IWL_RATE_18M_INDEX,
+       [IWL_RATE_36M_INDEX] = IWL_RATE_24M_INDEX,
+       [IWL_RATE_48M_INDEX] = IWL_RATE_36M_INDEX,
+       [IWL_RATE_54M_INDEX] = IWL_RATE_48M_INDEX,
+       [IWL_RATE_60M_INDEX] = IWL_RATE_54M_INDEX,
 };
 
 static const u8 ant_toggle_lookup[] = {
-       /*ANT_NONE -> */ ANT_NONE,
-       /*ANT_A    -> */ ANT_B,
-       /*ANT_B    -> */ ANT_C,
-       /*ANT_AB   -> */ ANT_BC,
-       /*ANT_C    -> */ ANT_A,
-       /*ANT_AC   -> */ ANT_AB,
-       /*ANT_BC   -> */ ANT_AC,
-       /*ANT_ABC  -> */ ANT_ABC,
+       [ANT_NONE] = ANT_NONE,
+       [ANT_A] = ANT_B,
+       [ANT_B] = ANT_C,
+       [ANT_AB] = ANT_BC,
+       [ANT_C] = ANT_A,
+       [ANT_AC] = ANT_AB,
+       [ANT_BC] = ANT_AC,
+       [ANT_ABC] = ANT_ABC,
 };
 
 #define IWL_DECLARE_RATE_INFO(r, s, ip, in, rp, rn, pp, np)    \