]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rtl8192e: Don't copy huge struct by value (and make it const).
authorJesper Juhl <jj@chaosbits.net>
Sun, 6 Nov 2011 23:21:26 +0000 (00:21 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 27 Nov 2011 01:19:23 +0000 (17:19 -0800)
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: Jesper Juhl <jj@chaosbits.net>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/rtl8192e/rtllib.h
drivers/staging/rtl8192e/rtllib_softmac.c

index de25975ccee47563083b36df4b39ac1b3d686d81..3a52120657155beb9819c8576b550507d8744c4a 100644 (file)
@@ -2804,7 +2804,7 @@ extern int rtllib_wx_set_gen_ie(struct rtllib_device *ieee, u8 *ie, size_t len);
 
 /* rtllib_softmac.c */
 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,
                                   struct sk_buff *skb,
                                   struct rtllib_rx_stats *rx_stats, u16 type,
index b5086850f0dee4ac5c05bccc7798013b0ff19e1f..fa774cf7fc788d7be2eaa03a2d639caf81dd74ad 100644 (file)
@@ -28,9 +28,9 @@ short rtllib_is_54g(struct rtllib_network *net)
        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