From: Yury Norov <yury.norov@gmail.com>
To: Torsten Hilbrich <torsten.hilbrich@secunet.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] include/uapi: Fix invalid use of BITS_PER_LONG in __swab
Date: Wed, 12 Feb 2020 00:21:03 -0800 [thread overview]
Message-ID: <20200212082103.GA19517@yury-thinkpad> (raw)
In-Reply-To: <6ecc4021-9beb-2ceb-98ba-5fc8954a05e1@secunet.com>
On Wed, Feb 12, 2020 at 08:51:06AM +0100, Torsten Hilbrich wrote:
> This caused compile problems in user-space application using that
> header. Seen with systemd:
>
> In file included from /build/client/devel/kernel/_/usr/include/linux/byteorder/little_endian.h:13,
> from /build/client/devel/kernel/_/usr/include/asm/byteorder.h: ,
> from /build/client/devel/kernel/_/usr/include/linux/icmpv6.h:6,
> from ../src/network/networkd-route.c:3:
> /build/client/devel/kernel/_/usr/include/linux/swab.h: In function ‘__swab’:
> /build/client/devel/kernel/_/usr/include/linux/swab.h:138:5: error: "BITS_PER_LONG" is not defined, evaluates to 0 [-Werror=undef]
> #if BITS_PER_LONG == 64
> ^~~~~~~~~~~~~
> cc1: some warnings being treated as errors
> [181/1207] Generating sys with a custom command.
> ninja: build stopped: subcommand failed.
>
> Signed-off-by: Torsten Hilbrich <torsten.hilbrich@secunet.com>
> ---
> include/uapi/linux/swab.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/uapi/linux/swab.h b/include/uapi/linux/swab.h
> index fa7f97da5b76..7272f85d6d6a 100644
> --- a/include/uapi/linux/swab.h
> +++ b/include/uapi/linux/swab.h
> @@ -135,9 +135,9 @@ static inline __attribute_const__ __u32 __fswahb32(__u32 val)
>
> static __always_inline unsigned long __swab(const unsigned long y)
> {
> -#if BITS_PER_LONG == 64
> +#if __BITS_PER_LONG == 64
> return __swab64(y);
> -#else /* BITS_PER_LONG == 32 */
> +#else /* __BITS_PER_LONG == 32 */
> return __swab32(y);
> #endif
> }
> --
> 2.20.1
Acked-by: Yury Norov <yury.norov@gmail.com>
prev parent reply other threads:[~2020-02-12 8:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-12 7:51 [PATCH] include/uapi: Fix invalid use of BITS_PER_LONG in __swab Torsten Hilbrich
2020-02-12 8:21 ` Yury Norov [this message]
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=20200212082103.GA19517@yury-thinkpad \
--to=yury.norov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torsten.hilbrich@secunet.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