Commit ce254243 authored by Colin Ian King's avatar Colin Ian King Committed by Kalle Valo
Browse files

rtlwifi: pass struct rtl_stats by reference as it is more efficient



passing rtl_stats by value is inefficient; the structure is over 300
bytes in size and generally just one field (packet_report_type)
is being accessed, so the pass by value is a relatively large overhead.
This change just affects just the rx_command_packet calls.

Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 064b32f8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -855,7 +855,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
		}
		/* handle command packet here */
		if (rtlpriv->cfg->ops->rx_command_packet &&
		    rtlpriv->cfg->ops->rx_command_packet(hw, stats, skb)) {
		    rtlpriv->cfg->ops->rx_command_packet(hw, &stats, skb)) {
				dev_kfree_skb_any(skb);
				goto new_trx_end;
		}
+1 −1
Original line number Diff line number Diff line
@@ -851,7 +851,7 @@ void rtl88ee_tx_polling(struct ieee80211_hw *hw, u8 hw_queue)
}

u32 rtl88ee_rx_command_packet(struct ieee80211_hw *hw,
			      struct rtl_stats status,
			      const struct rtl_stats *status,
			      struct sk_buff *skb)
{
	return 0;
+1 −1
Original line number Diff line number Diff line
@@ -790,7 +790,7 @@ void rtl88ee_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
			     bool firstseg, bool lastseg,
			     struct sk_buff *skb);
u32 rtl88ee_rx_command_packet(struct ieee80211_hw *hw,
			      struct rtl_stats status,
			      const struct rtl_stats *status,
			      struct sk_buff *skb);

#endif
+3 −3
Original line number Diff line number Diff line
@@ -1105,13 +1105,13 @@ void rtl92ee_tx_polling(struct ieee80211_hw *hw, u8 hw_queue)
}

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;
@@ -1121,7 +1121,7 @@ u32 rtl92ee_rx_command_packet(struct ieee80211_hw *hw,
		break;
	default:
		RT_TRACE(rtlpriv, COMP_RECV, DBG_TRACE,
			 "Unknown packet type %d\n", status.packet_report_type);
			 "Unknown packet type %d\n", status->packet_report_type);
		break;
	}

+1 −1
Original line number Diff line number Diff line
@@ -857,6 +857,6 @@ void rtl92ee_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
			     bool firstseg, bool 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
Loading