From: Matthias Schiffer <mschiffer@universe-factory.net>
To: Antonio Quartulli <antonio@meshcoding.com>
Cc: The list for a Better Approach To Mobile Ad-hoc Networking
<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: add compat code for kstrtou32
Date: Thu, 21 Nov 2013 04:45:14 +0100 [thread overview]
Message-ID: <528D81CA.8000106@universe-factory.net> (raw)
In-Reply-To: <1384845967-2497-1-git-send-email-antonio@meshcoding.com>
[-- Attachment #1: Type: text/plain, Size: 996 bytes --]
On 11/19/2013 08:26 AM, Antonio Quartulli wrote:
> kstrtou32() does not exist before 2.6.39. Convert it to
> strict_strtoul() in that case.
>
> Used-by: e29249b4483b91d7a590a16e9b5ffe9412ce7fde
> ("batman-adv: add isolation_mark sysfs attribute")
>
> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
> ---
> compat.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/compat.h b/compat.h
> index 01984b8..334dc5c 100644
> --- a/compat.h
> +++ b/compat.h
> @@ -152,6 +152,8 @@ static inline int batadv_param_set_copystring(const char *val,
>
> #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
>
> +/* cast last argument of strict_strtoul() because we have a uint32_t */
> +#define kstrtou32(cp, base, v) strict_strtoul(cp, base, (unsigned long *)v)
> #define kstrtoul strict_strtoul
> #define kstrtol strict_strtol
>
>
You are casting a u32 * to unsigned long *? Won't this break horribly
when sizeof(u32) != sizeof(unsigned long)?
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
next prev parent reply other threads:[~2013-11-21 3:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-19 7:26 [B.A.T.M.A.N.] [PATCH] batman-adv: add compat code for kstrtou32 Antonio Quartulli
2013-11-21 1:20 ` Marek Lindner
2013-11-21 3:45 ` Matthias Schiffer [this message]
2013-11-21 7:21 ` Antonio Quartulli
2013-11-21 13:57 ` Matthias Schiffer
2013-11-21 14:20 ` Antonio Quartulli
2013-11-21 14:31 ` Matthias Schiffer
2013-11-21 14:40 ` Antonio Quartulli
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=528D81CA.8000106@universe-factory.net \
--to=mschiffer@universe-factory.net \
--cc=antonio@meshcoding.com \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/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