Hi all,
After merging the net-next tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:
In file included from net/ethtool/netlink.c:6:
net/ethtool/netlink.h:177:20: error: redefinition of 'ethnl_update_bool'
177 | static inline void ethnl_update_bool(bool *dst, const struct nlattr *attr,
| ^~~~~~~~~~~~~~~~~
net/ethtool/netlink.h:125:20: note: previous definition of 'ethnl_update_bool' with type 'void(bool *, const struct nlattr *, bool *)' {aka 'void(_Bool *, const struct nlattr *, _Bool *)'}
125 | static inline void ethnl_update_bool(bool *dst, const struct nlattr *attr,
| ^~~~~~~~~~~~~~~~~
Caused by commit
dc0b98a1758f ("ethtool: Add and use ethnl_update_bool.")
merging badly with commit
7c494a7749a7 ("net: ethtool: netlink: introduce ethnl_update_bool()")
from the net tree.
I applied the following merge fix up.
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 24 Jan 2023 09:58:16 +1100
Subject: [PATCH] fix up for "ethtool: Add and use ethnl_update_bool."
interacting with "net: ethtool: netlink: introduce ethnl_update_bool()"
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
net/ethtool/netlink.h | 26 --------------------------
1 file changed, 26 deletions(-)
diff --git a/net/ethtool/netlink.h b/net/ethtool/netlink.h
index 4992fab0d06b..b01f7cd542c4 100644
--- a/net/ethtool/netlink.h
+++ b/net/ethtool/netlink.h
@@ -111,32 +111,6 @@ static inline void ethnl_update_u8(u8 *dst, const struct nlattr *attr,
*mod = true;
}
-/**
- * ethnl_update_bool() - update bool from NLA_U8 attribute
- * @dst: value to update
- * @attr: netlink attribute with new value or null
- * @mod: pointer to bool for modification tracking
- *
- * Use the u8 value from NLA_U8 netlink attribute @attr to set bool variable
- * pointed to by @dst to false (if zero) or 1 (if not); do nothing if @attr is
- * null. Bool pointed to by @mod is set to true if this function changed the
- * logical value of *dst, otherwise it is left as is.
- */
-static inline void ethnl_update_bool(bool *dst, const struct nlattr *attr,
- bool *mod)
-{
- u8 val;
-
- if (!attr)
- return;
- val = !!nla_get_u8(attr);
- if (*dst == val)
- return;
-
- *dst = val;
- *mod = true;
-}
-
/**
* ethnl_update_bool32() - update u32 used as bool from NLA_U8 attribute
* @dst: value to update
--
2.35.1
--
Cheers,
Stephen Rothwell
Hello:
This patch was applied to netdev/net.git (master)
by Paolo Abeni <pabeni@redhat.com>:
On Tue, 24 Jan 2023 10:02:49 +1100 you wrote:
> Hi all,
>
> After merging the net-next tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
>
> In file included from net/ethtool/netlink.c:6:
> net/ethtool/netlink.h:177:20: error: redefinition of 'ethnl_update_bool'
> 177 | static inline void ethnl_update_bool(bool *dst, const struct nlattr *attr,
> | ^~~~~~~~~~~~~~~~~
> net/ethtool/netlink.h:125:20: note: previous definition of 'ethnl_update_bool' with type 'void(bool *, const struct nlattr *, bool *)' {aka 'void(_Bool *, const struct nlattr *, _Bool *)'}
> 125 | static inline void ethnl_update_bool(bool *dst, const struct nlattr *attr,
> | ^~~~~~~~~~~~~~~~~
>
> [...]
Here is the summary with links:
- linux-next: build failure after merge of the net-next tree
https://git.kernel.org/netdev/net/c/d968117a7e8e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Hi Stephen,
On 24/01/2023 00:02, Stephen Rothwell wrote:
> Hi all,
>
> After merging the net-next tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
>
> In file included from net/ethtool/netlink.c:6:
> net/ethtool/netlink.h:177:20: error: redefinition of 'ethnl_update_bool'
> 177 | static inline void ethnl_update_bool(bool *dst, const struct nlattr *attr,
> | ^~~~~~~~~~~~~~~~~
> net/ethtool/netlink.h:125:20: note: previous definition of 'ethnl_update_bool' with type 'void(bool *, const struct nlattr *, bool *)' {aka 'void(_Bool *, const struct nlattr *, _Bool *)'}
> 125 | static inline void ethnl_update_bool(bool *dst, const struct nlattr *attr,
> | ^~~~~~~~~~~~~~~~~
Thank you for the patch, we had the same issue in MPTCP tree when
merging net and net-next.
> Caused by commit
>
> dc0b98a1758f ("ethtool: Add and use ethnl_update_bool.")
>
> merging badly with commit
>
> 7c494a7749a7 ("net: ethtool: netlink: introduce ethnl_update_bool()")
>
> from the net tree.
>
> I applied the following merge fix up.
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Tue, 24 Jan 2023 09:58:16 +1100
> Subject: [PATCH] fix up for "ethtool: Add and use ethnl_update_bool."
>
> interacting with "net: ethtool: netlink: introduce ethnl_update_bool()"
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> net/ethtool/netlink.h | 26 --------------------------
> 1 file changed, 26 deletions(-)
>
> diff --git a/net/ethtool/netlink.h b/net/ethtool/netlink.h
> index 4992fab0d06b..b01f7cd542c4 100644
> --- a/net/ethtool/netlink.h
> +++ b/net/ethtool/netlink.h
> @@ -111,32 +111,6 @@ static inline void ethnl_update_u8(u8 *dst, const struct nlattr *attr,
> *mod = true;
> }
>
> -/**
> - * ethnl_update_bool() - update bool from NLA_U8 attribute
> - * @dst: value to update
> - * @attr: netlink attribute with new value or null
> - * @mod: pointer to bool for modification tracking
> - *
> - * Use the u8 value from NLA_U8 netlink attribute @attr to set bool variable
> - * pointed to by @dst to false (if zero) or 1 (if not); do nothing if @attr is
> - * null. Bool pointed to by @mod is set to true if this function changed the
> - * logical value of *dst, otherwise it is left as is.
> - */
> -static inline void ethnl_update_bool(bool *dst, const struct nlattr *attr,
> - bool *mod)
> -{
> - u8 val;
> -
> - if (!attr)
> - return;
> - val = !!nla_get_u8(attr);
> - if (*dst == val)
> - return;
> -
> - *dst = val;
> - *mod = true;
> -}
Small detail: should we not remove the other one -- introduced by commit
dc0b98a1758f ("ethtool: Add and use ethnl_update_bool.") -- instead? The
other one has some typos in the description and is using "!!*dst" while
it is not needed if I'm not mistaken.
In MPTCP tree for the moment, I removed the other one but I will follow
up on which one I need to discard :)
Just in case, I attached the patch I used. I can send it properly if needed.
Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
© 2016 - 2026 Red Hat, Inc.