Commit bc4f07c8 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Greg Kroah-Hartman

staging: rtl8192ee: Pass large struct by const reference

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: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 57fc3b7c
...@@ -892,7 +892,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -892,7 +892,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
} }
/* handle command packet here */ /* 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); dev_kfree_skb_any(skb);
goto end; goto end;
} }
......
...@@ -1263,13 +1263,13 @@ bool rtl92ee_is_tx_desc_closed(struct ieee80211_hw *hw, u8 hw_queue, u16 index) ...@@ -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, u32 rtl92ee_rx_command_packet(struct ieee80211_hw *hw,
struct rtl_stats status, const struct rtl_stats *status,
struct sk_buff *skb) struct sk_buff *skb)
{ {
u32 result = 0; u32 result = 0;
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
switch (status.packet_report_type) { switch (status->packet_report_type) {
case NORMAL_RX: case NORMAL_RX:
result = 0; result = 0;
break; break;
......
...@@ -872,6 +872,6 @@ void rtl92ee_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc, ...@@ -872,6 +872,6 @@ void rtl92ee_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
bool b_firstseg, bool b_lastseg, bool b_firstseg, bool b_lastseg,
struct sk_buff *skb); struct sk_buff *skb);
u32 rtl92ee_rx_command_packet(struct ieee80211_hw *hw, u32 rtl92ee_rx_command_packet(struct ieee80211_hw *hw,
struct rtl_stats status, const struct rtl_stats *status,
struct sk_buff *skb); struct sk_buff *skb);
#endif #endif
...@@ -1946,7 +1946,7 @@ struct rtl_hal_ops { ...@@ -1946,7 +1946,7 @@ struct rtl_hal_ops {
u32 cmd_len, u8 *p_cmdbuffer); u32 cmd_len, u8 *p_cmdbuffer);
bool (*get_btc_status)(void); bool (*get_btc_status)(void);
u32 (*rx_command_packet)(struct ieee80211_hw *hw, 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, void (*add_wowlan_pattern)(struct ieee80211_hw *hw,
struct rtl_wow_pattern *rtl_pattern, struct rtl_wow_pattern *rtl_pattern,
u8 index); u8 index);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment