From: Luis R. Rodriguez Date: Tue, 13 Oct 2009 20:45:20 +0000 (-0700) Subject: Shut up compiler on compiling mac80211 for unused variable X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2c72471dbf8093831bcd5822a254f9b5f20351f5;p=openwrt%2Fstaging%2Fblogic.git Shut up compiler on compiling mac80211 for unused variable We can avoid this compiler warning by using the used variable on the if (0) branch as that is never going to happen anyway. CC [M] /home/mcgrof/devel/compat-wireless-2.6/net/wireless/scan.o /home/mcgrof/devel/compat-wireless-2.6/net/wireless/scan.c: In function ‘cfg80211_bss_update’: /home/mcgrof/devel/compat-wireless-2.6/net/wireless/scan.c:422: warning: unused variable ‘used’ Signed-off-by: Luis R. Rodriguez --- diff --git a/compat/patches/02-ksize.patch b/compat/patches/02-ksize.patch index e216dae39224..6d976758b73e 100644 --- a/compat/patches/02-ksize.patch +++ b/compat/patches/02-ksize.patch @@ -12,12 +12,13 @@ of the situation. --- a/net/wireless/scan.c 2009-09-02 14:13:33.769092519 -0700 +++ b/net/wireless/scan.c 2009-09-02 14:13:34.925094548 -0700 -@@ -422,7 +422,11 @@ +@@ -422,7 +422,12 @@ size_t used = dev->wiphy.bss_priv_size + sizeof(*res); size_t ielen = res->pub.len_information_elements; +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,28) + if (0) { ++ used = 0; /* just to shut up the compiler */ +#else if (!found->ies_allocated && ksize(found) >= used + ielen) { +#endif