]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
staging: rtl8192ee: Pass large struct by const reference
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Tue, 1 Jul 2014 10:25:45 +0000 (12:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Jul 2014 23:51:48 +0000 (16:51 -0700)
struct rtl_stats is rather huge (152 bytes), and since
rtl92ee_rx_command_packet() does not modify it, it might as
well be passed by const reference.

Reported by Coverity: CID 1222131

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192ee/pci.c
drivers/staging/rtl8192ee/rtl8192ee/trx.c
drivers/staging/rtl8192ee/rtl8192ee/trx.h
drivers/staging/rtl8192ee/wifi.h

index 3fe9b7ba01d6079dc67a735d1dc6c656680b683e..f3abbcc9f3ba70a065d60b50627a2037716d6680 100644 (file)
@@ -892,7 +892,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
                }
 
                /* handle command packet here */
-               if (rtlpriv->cfg->ops->rx_command_packet(hw, stats, skb)) {
+               if (rtlpriv->cfg->ops->rx_command_packet(hw, &stats, skb)) {
                                dev_kfree_skb_any(skb);
                                goto end;
                }
index c930f52ec8c8af63b93ca44f82020fe7414e338e..1190c8bdb0d3f49440dec68e73a89acf58970a4a 100644 (file)
@@ -1263,13 +1263,13 @@ bool rtl92ee_is_tx_desc_closed(struct ieee80211_hw *hw, u8 hw_queue, u16 index)
 }
 
 u32 rtl92ee_rx_command_packet(struct ieee80211_hw *hw,
-                             struct rtl_stats status,
+                             const struct rtl_stats *status,
                              struct sk_buff *skb)
 {
        u32 result = 0;
        struct rtl_priv *rtlpriv = rtl_priv(hw);
 
-       switch (status.packet_report_type) {
+       switch (status->packet_report_type) {
        case NORMAL_RX:
                result = 0;
                break;
index c2cd5813a2b9b2d51e07cf79197dd8c8ecff7024..e04ee7e6d9b2d4074038755607240abe97a9f372 100644 (file)
@@ -872,6 +872,6 @@ void rtl92ee_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
                             bool b_firstseg, bool b_lastseg,
                             struct sk_buff *skb);
 u32 rtl92ee_rx_command_packet(struct ieee80211_hw *hw,
-                             struct rtl_stats status,
+                             const struct rtl_stats *status,
                              struct sk_buff *skb);
 #endif
index 96fa261a70a5696c473d914bb4e1075460883d17..a37176af845e5ef3b64886dad3e205e4aa81b3c8 100644 (file)
@@ -1946,7 +1946,7 @@ struct rtl_hal_ops {
                             u32 cmd_len, u8 *p_cmdbuffer);
        bool (*get_btc_status)(void);
        u32 (*rx_command_packet)(struct ieee80211_hw *hw,
-                                struct rtl_stats status, struct sk_buff *skb);
+                                const struct rtl_stats *status, struct sk_buff *skb);
        void (*add_wowlan_pattern)(struct ieee80211_hw *hw,
                                   struct rtl_wow_pattern *rtl_pattern,
                                   u8 index);