From 2c72471dbf8093831bcd5822a254f9b5f20351f5 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Tue, 13 Oct 2009 13:45:20 -0700 Subject: [PATCH] Shut up compiler on compiling mac80211 for unused variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- compat/patches/02-ksize.patch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.30.2