Repository : ssh://git@open-mesh.org/batman-adv
On branches: ecsv/perf_hacks,ecsv/pu,master
>---------------------------------------------------------------
commit 7bb9b06ac44dfd0189cf58d6564bfc890cc10e9c
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Thu Oct 31 17:34:37 2019 +0100
batman-adv: Use 'fallthrough' pseudo keyword
The usage of the '/* fall through */' comments in switches are no longer
marked as non-deprecated variant of implicit fall throughs for switch
statements. The commit 294f69e662d1 ("compiler_attributes.h: Add
'fallthrough' pseudo keyword for switch/case use") introduced a replacement
keyword which should be used instead.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
>---------------------------------------------------------------
7bb9b06ac44dfd0189cf58d6564bfc890cc10e9c
compat-include/linux/compiler.h | 9 +++++++++
compat-sources/net/core/skbuff.c | 4 ++--
net/batman-adv/multicast.c | 2 +-
net/batman-adv/soft-interface.c | 4 ++--
4 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/compat-include/linux/compiler.h b/compat-include/linux/compiler.h
index e9ccbc6e..a4704209 100644
--- a/compat-include/linux/compiler.h
+++ b/compat-include/linux/compiler.h
@@ -27,4 +27,13 @@
#endif /* < KERNEL_VERSION(3, 19, 0) */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
+
+#ifndef fallthrough
+#define fallthrough do {} while (0) /* fallthrough */
+#endif
+
+#endif /* < KERNEL_VERSION(5, 4, 0) */
+
#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_COMPILER_H_ */
diff --git a/compat-sources/net/core/skbuff.c b/compat-sources/net/core/skbuff.c
index 7386b3c7..16ec56ef 100644
--- a/compat-sources/net/core/skbuff.c
+++ b/compat-sources/net/core/skbuff.c
@@ -46,7 +46,7 @@ __sum16 skb_checksum_simple_validate(struct sk_buff *skb)
case CHECKSUM_COMPLETE:
if (!csum_fold(skb->csum))
break;
- /* fall through */
+ fallthrough;
case CHECKSUM_NONE:
skb->csum = 0;
return skb_checksum_complete(skb);
@@ -72,7 +72,7 @@ skb_checksum_validate(struct sk_buff *skb, int proto,
if (!csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr, skb->len,
IPPROTO_ICMPV6, skb->csum))
break;
- /*FALLTHROUGH*/
+ fallthrough;
case CHECKSUM_NONE:
skb->csum = ~csum_unfold(csum_ipv6_magic(&ip6h->saddr,
&ip6h->daddr,
diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
index 1d5bdf3a..f9ec8e75 100644
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -1421,7 +1421,7 @@ batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
if (*orig)
return BATADV_FORW_SINGLE;
- /* fall through */
+ fallthrough;
case 0:
return BATADV_FORW_NONE;
default:
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index a203dc1b..832e156c 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -229,7 +229,7 @@ static netdev_tx_t batadv_interface_tx(struct sk_buff *skb,
break;
}
- /* fall through */
+ fallthrough;
case ETH_P_BATMAN:
goto dropped;
}
@@ -454,7 +454,7 @@ void batadv_interface_rx(struct net_device *soft_iface,
if (vhdr->h_vlan_encapsulated_proto != htons(ETH_P_BATMAN))
break;
- /* fall through */
+ fallthrough;
case ETH_P_BATMAN:
goto dropped;
}