staging: brcm80211: resolved checkpatch warnings in LCN phy
authorRoland Vossen <rvossen@broadcom.com>
Mon, 8 Aug 2011 13:58:20 +0000 (15:58 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 23 Aug 2011 20:00:01 +0000 (13:00 -0700)
Refactored code to not exceed the 80 char limit.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Henry Ptasinski <henryp@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c

index a109866dcf2612c41319c253468e040b2517d5ac..3d140eb0bc5091e5b939d37df9d12a8c6951204c 100644 (file)
@@ -4342,39 +4342,25 @@ static void wlc_lcnphy_tbl_init(struct brcms_phy *pi)
        }
 
        if (LCNREV_IS(pi->pubpi.phy_rev, 2)) {
+               const struct phytbl_info *tb;
+               int l;
+
                if (CHSPEC_IS2G(pi->radio_chanspec)) {
-                       for (idx = 0;
-                            idx < dot11lcnphytbl_rx_gain_info_2G_rev2_sz;
-                            idx++)
-                               if (pi->sh->boardflags & BFL_EXTLNA)
-                                       wlc_lcnphy_write_table(
-                                               pi,
-                                               &
-                                               dot11lcnphytbl_rx_gain_info_extlna_2G_rev2
-                                               [idx]);
-                               else
-                                       wlc_lcnphy_write_table(
-                                               pi,
-                                               &
-                                               dot11lcnphytbl_rx_gain_info_2G_rev2
-                                               [idx]);
+                       l = dot11lcnphytbl_rx_gain_info_2G_rev2_sz;
+                       if (pi->sh->boardflags & BFL_EXTLNA)
+                               tb = dot11lcnphytbl_rx_gain_info_extlna_2G_rev2;
+                       else
+                               tb = dot11lcnphytbl_rx_gain_info_2G_rev2;
                } else {
-                       for (idx = 0;
-                            idx < dot11lcnphytbl_rx_gain_info_5G_rev2_sz;
-                            idx++)
-                               if (pi->sh->boardflags & BFL_EXTLNA_5GHz)
-                                       wlc_lcnphy_write_table(
-                                               pi,
-                                               &
-                                               dot11lcnphytbl_rx_gain_info_extlna_5G_rev2
-                                               [idx]);
-                               else
-                                       wlc_lcnphy_write_table(
-                                               pi,
-                                               &
-                                               dot11lcnphytbl_rx_gain_info_5G_rev2
-                                               [idx]);
+                       l = dot11lcnphytbl_rx_gain_info_5G_rev2_sz;
+                       if (pi->sh->boardflags & BFL_EXTLNA_5GHz)
+                               tb = dot11lcnphytbl_rx_gain_info_extlna_5G_rev2;
+                       else
+                               tb = dot11lcnphytbl_rx_gain_info_5G_rev2;
                }
+
+               for (idx = 0; idx < l; idx++)
+                       wlc_lcnphy_write_table(pi, &tb[idx]);
        }
 
        if ((pi->sh->boardflags & BFL_FEM)