Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f03053b authored by Jesper Juhl's avatar Jesper Juhl Committed by Greg Kroah-Hartman
Browse files

rtl8192e: Don't copy huge struct by value (and make it const).



rtllib_is_shortslot() takes one argument - a struct that's more than a
kilobyte large. It should take a pointer instead of copying such a
huge struct - and the argument might as well be declared 'const' now
that we are at it, since it is not modified. This patch makes these
changes.

Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7c19c1e8
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2804,7 +2804,7 @@ extern int rtllib_wx_set_gen_ie(struct rtllib_device *ieee, u8 *ie, size_t len);


/* rtllib_softmac.c */
/* rtllib_softmac.c */
extern short rtllib_is_54g(struct rtllib_network *net);
extern short rtllib_is_54g(struct rtllib_network *net);
extern short rtllib_is_shortslot(struct rtllib_network net);
extern short rtllib_is_shortslot(const struct rtllib_network *net);
extern int rtllib_rx_frame_softmac(struct rtllib_device *ieee,
extern int rtllib_rx_frame_softmac(struct rtllib_device *ieee,
				   struct sk_buff *skb,
				   struct sk_buff *skb,
				   struct rtllib_rx_stats *rx_stats, u16 type,
				   struct rtllib_rx_stats *rx_stats, u16 type,
+2 −2
Original line number Original line Diff line number Diff line
@@ -28,9 +28,9 @@ short rtllib_is_54g(struct rtllib_network *net)
	return (net->rates_ex_len > 0) || (net->rates_len > 4);
	return (net->rates_ex_len > 0) || (net->rates_len > 4);
}
}


short rtllib_is_shortslot(struct rtllib_network net)
short rtllib_is_shortslot(const struct rtllib_network *net)
{
{
	return net.capability & WLAN_CAPABILITY_SHORT_SLOT_TIME;
	return net->capability & WLAN_CAPABILITY_SHORT_SLOT_TIME;
}
}


/* returns the total length needed for pleacing the RATE MFIE
/* returns the total length needed for pleacing the RATE MFIE