From: Michael Buesch <mb@bu3sch.de>
To: Luis Rodriguez <mcgrof@gmail.com>
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH compat] Fix ksize() breakage on older kernels
Date: Sat, 25 Apr 2009 22:16:19 +0200 [thread overview]
Message-ID: <200904252216.19842.mb@bu3sch.de> (raw)
The following patch should fix the ksize() compilation error
for older kernels without exported ksize().
Signed-off-by: Michael Buesch <mb@bu3sch.de>
---
Index: compat-wireless-2009-04-20/net/wireless/scan.c
===================================================================
--- compat-wireless-2009-04-20.orig/net/wireless/scan.c 2009-04-25 21:58:17.000000000 +0200
+++ compat-wireless-2009-04-20/net/wireless/scan.c 2009-04-25 22:00:01.000000000 +0200
@@ -377,7 +377,11 @@
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) {
+#else
if (ksize(found) >= used + ielen) {
+#endif
memcpy(found->pub.information_elements,
res->pub.information_elements, ielen);
found->pub.len_information_elements = ielen;
@@ -385,9 +389,8 @@
u8 *ies = found->pub.information_elements;
if (found->ies_allocated) {
- if (ksize(ies) < ielen)
- ies = krealloc(ies, ielen,
- GFP_ATOMIC);
+ ies = krealloc(ies, ielen,
+ GFP_ATOMIC);
} else
ies = kmalloc(ielen, GFP_ATOMIC);
--
Greetings, Michael.
reply other threads:[~2009-04-25 20:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200904252216.19842.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=linux-wireless@vger.kernel.org \
--cc=mcgrof@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).