]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
rtlwifi: Simplify rtl_get/set inline functions
authorJoe Perches <joe@perches.com>
Sat, 17 Mar 2012 20:36:30 +0000 (13:36 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 9 Apr 2012 20:09:33 +0000 (16:09 -0400)
Use a temporary to make the code a bit neater.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtlwifi/wifi.h

index b591614c3b9bb79c7b6e00ec6fe48cb8b06c480b..0f1d21175d6a5d8846b3232c1f8fa7ea15ec2fbd 100644 (file)
@@ -1954,37 +1954,35 @@ static inline void rtl_write_dword(struct rtl_priv *rtlpriv,
 static inline u32 rtl_get_bbreg(struct ieee80211_hw *hw,
                                u32 regaddr, u32 bitmask)
 {
-       return ((struct rtl_priv *)(hw)->priv)->cfg->ops->get_bbreg(hw,
-                                                                   regaddr,
-                                                                   bitmask);
+       struct rtl_priv *rtlpriv = hw->priv;
+
+       return rtlpriv->cfg->ops->get_bbreg(hw, regaddr, bitmask);
 }
 
 static inline void rtl_set_bbreg(struct ieee80211_hw *hw, u32 regaddr,
                                 u32 bitmask, u32 data)
 {
-       ((struct rtl_priv *)(hw)->priv)->cfg->ops->set_bbreg(hw,
-                                                            regaddr, bitmask,
-                                                            data);
+       struct rtl_priv *rtlpriv = hw->priv;
 
+       rtlpriv->cfg->ops->set_bbreg(hw, regaddr, bitmask, data);
 }
 
 static inline u32 rtl_get_rfreg(struct ieee80211_hw *hw,
                                enum radio_path rfpath, u32 regaddr,
                                u32 bitmask)
 {
-       return ((struct rtl_priv *)(hw)->priv)->cfg->ops->get_rfreg(hw,
-                                                                   rfpath,
-                                                                   regaddr,
-                                                                   bitmask);
+       struct rtl_priv *rtlpriv = hw->priv;
+
+       return rtlpriv->cfg->ops->get_rfreg(hw, rfpath, regaddr, bitmask);
 }
 
 static inline void rtl_set_rfreg(struct ieee80211_hw *hw,
                                 enum radio_path rfpath, u32 regaddr,
                                 u32 bitmask, u32 data)
 {
-       ((struct rtl_priv *)(hw)->priv)->cfg->ops->set_rfreg(hw,
-                                                            rfpath, regaddr,
-                                                            bitmask, data);
+       struct rtl_priv *rtlpriv = hw->priv;
+
+       rtlpriv->cfg->ops->set_rfreg(hw, rfpath, regaddr, bitmask, data);
 }
 
 static inline bool is_hal_stop(struct rtl_hal *rtlhal)