From: Linus Walleij <linus.walleij@linaro.org>
To: kernel test robot <lkp@intel.com>,
Mark Brown <broonie@kernel.org>,
Bart Van Assche <bvanassche@acm.org>,
Harvey Harrison <harvey.harrison@gmail.com>
Cc: kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: Re: [linux-next:master 2008/10581] include/linux/unaligned/be_byteshift.h:41:19: error: redefinition of 'get_unaligned_be16'
Date: Fri, 12 Feb 2021 17:43:19 +0100 [thread overview]
Message-ID: <CACRpkdYsrz1NjjdisXa7C+jQEppT6AJUDPyX=MC4QbU_omXcmA@mail.gmail.com> (raw)
In-Reply-To: <202102120711.q6HS8p2m-lkp@intel.com>
On Fri, Feb 12, 2021 at 12:53 AM kernel test robot <lkp@intel.com> wrote:
But what kind of syntactic trainwreck is this!
(...)
> commit: de8860b1ed4701ea7e6f760f02d79ca6a3b656a1 [2008/10581] iio: magnetometer: Add driver for Yamaha YAS530
(...)
> In file included from drivers/iio/magnetometer/yamaha-yas530.c:35:
> include/linux/unaligned/be_byteshift.h: At top level:
> >> include/linux/unaligned/be_byteshift.h:41:19: error: redefinition of 'get_unaligned_be16'
> 41 | static inline u16 get_unaligned_be16(const void *p)
> | ^~~~~~~~~~~~~~~~~~
(...)
> from include/linux/regulator/consumer.h:35,
> from drivers/iio/magnetometer/yamaha-yas530.c:33:
> include/linux/unaligned/be_struct.h:7:19: note: previous definition of 'get_unaligned_be16' was here
> 7 | static inline u16 get_unaligned_be16(const void *p)
> | ^~~~~~~~~~~~~~~~~~
Inspecting be_byteshift.h and be_struct.h I do see that both of them
define get_unaligned_be16/32/64.
They both end up calling the different implementations of
__get_unaligned_be16/32/64 on top of that.
So include one or the other and never both at the same time?
Well that is hard to avoid if one of them is in turn included by other
headers such as the very generic <linux/regulator/consumer.h>
in this case.
Harvey, anyone: ideas on how to fix this?
One of them have to change name in the whole world I suppose?
I suppose my code is working either because they both do exactly
the same thing or thanks to the order I include the files :P
I have the feeling there is something I don't understand about how
this was thought out, like I must have missed something. All
the collisions are even in the same include directory :(
Yours,
Linus Walleij
next prev parent reply other threads:[~2021-02-12 16:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-11 23:52 kernel test robot
2021-02-12 16:43 ` Linus Walleij [this message]
2021-02-12 17:37 ` Harvey Harrison
2021-02-14 21:05 ` Linus Walleij
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='CACRpkdYsrz1NjjdisXa7C+jQEppT6AJUDPyX=MC4QbU_omXcmA@mail.gmail.com' \
--to=linus.walleij@linaro.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=andy.shevchenko@gmail.com \
--cc=broonie@kernel.org \
--cc=bvanassche@acm.org \
--cc=harvey.harrison@gmail.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.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