Shut up compiler on compiling mac80211 for unused variable
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Tue, 13 Oct 2009 20:45:20 +0000 (13:45 -0700)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Tue, 13 Oct 2009 22:45:19 +0000 (15:45 -0700)
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 <lrodriguez@atheros.com>
compat/patches/02-ksize.patch

index e216dae392247c50e85530a7e02359920241228d..6d976758b73ea940923d73c0bbba96bf46f9a3e8 100644 (file)
@@ -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