From: Arnd Bergmann <arnd@arndb.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
Jon Maloy <jmaloy@redhat.com>, Ying Xue <ying.xue@windriver.com>,
Masahiro Yamada <masahiroy@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Networking <netdev@vger.kernel.org>,
tipc-discussion@lists.sourceforge.net,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
llvm@lists.linux.dev, David Howells <dhowells@redhat.com>
Subject: Re: [PATCH] net, uapi: remove inclusion of arpa/inet.h
Date: Wed, 30 Mar 2022 08:11:00 +0200 [thread overview]
Message-ID: <CAK8P3a2RO7-SHKfe7b_LcG82gkca10c4fCJmjD_ToSP1Xm-yDA@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a37gvycJ4zbeVvD_=6Npuep52VEP7CrgS-_8y6OXK_U3Q@mail.gmail.com>
On Wed, Mar 30, 2022 at 8:08 AM Arnd Bergmann <arnd@arndb.de> wrote:
> On Wed, Mar 30, 2022 at 12:26 AM Nick Desaulniers
> <ndesaulniers@google.com> wrote:
> > On Tue, Mar 29, 2022 at 3:09 PM Nick Desaulniers <ndesaulniers@google.com> wrote:
> > ```
> > diff --git a/include/uapi/linux/byteorder/little_endian.h
> > b/include/uapi/linux/byteorder/little_endian.h
> > index cd98982e7523..c14f2c3728e2 100644
> > --- a/include/uapi/linux/byteorder/little_endian.h
> > +++ b/include/uapi/linux/byteorder/little_endian.h
> > @@ -103,5 +103,8 @@ static __always_inline __u16 __be16_to_cpup(const __be16 *p)
> > #define __cpu_to_be16s(x) __swab16s((x))
> > #define __be16_to_cpus(x) __swab16s((x))
> >
> > +#define htonl(x) __cpu_to_be32(x)
> > +#define htons(x) __cpu_to_be16(x)
> > +#define ntohs(x) __be16_to_cpu(x)
> >
>
> This is unfortunately a namespace violation, you can't define things in uapi
> headers that conflict with standard library interfaces.
nevermind, I just saw the thread continues and you arrived at a good solution
withusing the __cpu_to_be16() etc directly.
Arnd
next prev parent reply other threads:[~2022-03-30 6:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-29 21:29 [PATCH] net, uapi: remove inclusion of arpa/inet.h Nick Desaulniers
2022-03-29 21:50 ` Nick Desaulniers
2022-03-29 22:09 ` Nick Desaulniers
2022-03-29 22:26 ` Nick Desaulniers
2022-03-29 22:39 ` [PATCH v2] " Nick Desaulniers
2022-03-29 23:01 ` Jakub Kicinski
2022-03-29 23:12 ` Nick Desaulniers
2022-04-04 17:54 ` [PATCH net-next v3] " Nick Desaulniers
2022-04-06 13:10 ` patchwork-bot+netdevbpf
2022-03-30 6:08 ` [PATCH] " Arnd Bergmann
2022-03-30 6:11 ` Arnd Bergmann [this message]
2022-03-29 23:03 ` Nick Desaulniers
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=CAK8P3a2RO7-SHKfe7b_LcG82gkca10c4fCJmjD_ToSP1Xm-yDA@mail.gmail.com \
--to=arnd@arndb.de \
--cc=dhowells@redhat.com \
--cc=jmaloy@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=netdev@vger.kernel.org \
--cc=tipc-discussion@lists.sourceforge.net \
--cc=ying.xue@windriver.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).