🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #14495

[PATCH net-next 12/15] batman-adv: use matching return types for bool and void functions

#14495
From: Simon Wunderlich
Date: Wed, 11 Nov 2026 10:27
100 lines
12240 bytes
From: Sven Eckelmann <sven@narfation.org>

Some functions declare a different return type than the values they
actually return:

* batadv_mcast_forw_push_dests_list() is documented as returning
  true/false and only returns true/false, but was declared to return int
* the !CONFIG_BATMAN_ADV_DAT stub of batadv_dat_snoop_outgoing_arp_reply()
  returned bool, while the real function returns void
* the !CONFIG_BATMAN_ADV_MCAST stub of batadv_mcast_init() returned int,
  while the real function returns void

Make the declarations match.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/distributed-arp-table.h |  3 +--
 net/batman-adv/multicast.h             |  3 +--
 net/batman-adv/multicast_forw.c        | 18 +++++++++---------
 3 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/net/batman-adv/distributed-arp-table.h b/net/batman-adv/distributed-arp-table.h
index e7b75e82eb1d8..807178fd28c57 100644
--- a/net/batman-adv/distributed-arp-table.h
+++ b/net/batman-adv/distributed-arp-table.h
@@ -117,11 +117,10 @@ batadv_dat_snoop_incoming_arp_request(struct batadv_priv *bat_priv,
 	return false;
 }
 
-static inline bool
+static inline void
 batadv_dat_snoop_outgoing_arp_reply(struct batadv_priv *bat_priv,
 				    struct sk_buff *skb)
 {
-	return false;
 }
 
 static inline bool
diff --git a/net/batman-adv/multicast.h b/net/batman-adv/multicast.h
index d97ee51d26f2e..d46f3a25ba5f2 100644
--- a/net/batman-adv/multicast.h
+++ b/net/batman-adv/multicast.h
@@ -88,9 +88,8 @@ batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
 	return NET_XMIT_DROP;
 }
 
-static inline int batadv_mcast_init(struct batadv_priv *bat_priv)
+static inline void batadv_mcast_init(struct batadv_priv *bat_priv)
 {
-	return 0;
 }
 
 static inline int
diff --git a/net/batman-adv/multicast_forw.c b/net/batman-adv/multicast_forw.c
index 9ffed1f237b6b..8700f92b9bb0f 100644
--- a/net/batman-adv/multicast_forw.c
+++ b/net/batman-adv/multicast_forw.c
@@ -187,13 +187,13 @@ static bool batadv_mcast_forw_push_dest(struct batadv_priv *bat_priv,
  *
  * Return: true on success, false otherwise.
  */
-static int batadv_mcast_forw_push_dests_list(struct batadv_priv *bat_priv,
-					     struct sk_buff *skb,
-					     unsigned short vid,
-					     struct hlist_head *head,
-					     size_t entry_offset,
-					     unsigned short *num_dests,
-					     unsigned short *tvlv_len)
+static bool batadv_mcast_forw_push_dests_list(struct batadv_priv *bat_priv,
+					      struct sk_buff *skb,
+					      unsigned short vid,
+					      struct hlist_head *head,
+					      size_t entry_offset,
+					      unsigned short *num_dests,
+					      unsigned short *tvlv_len)
 {
 	struct batadv_orig_node *orig_node;
 	struct hlist_node *node;
@@ -278,7 +278,7 @@ static bool batadv_mcast_forw_push_want_all(struct batadv_priv *bat_priv,
 {
 	struct hlist_head *head = NULL;
 	size_t offset;
-	int ret;
+	bool ret;
 
 	switch (eth_hdr(skb)->h_proto) {
 	case htons(ETH_P_IP):
@@ -324,7 +324,7 @@ static bool batadv_mcast_forw_push_want_rtr(struct batadv_priv *bat_priv,
 {
 	struct hlist_head *head = NULL;
 	size_t offset;
-	int ret;
+	bool ret;
 
 	switch (eth_hdr(skb)->h_proto) {
 	case htons(ETH_P_IP):
-- 
2.47.3
Technical Details
Message-ID: <20261111102729.2096241-13-sw@simonwunderlich.de>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361000-linux-kernel-netdev=dewy.ru
References: <20261111102729.2096241-1-sw@simonwunderlich.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361000-linux-kernel-netdev=dewy.ru
From: sw@simonwunderlich.de (Simon Wunderlich)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next 12/15] batman-adv: use matching return types for bool and void functions
Date: Wed, 11 Nov 2026 11:27:26 +0100
Organization: Usenet Network
Message-ID: <20261111102729.2096241-13-sw@simonwunderlich.de>
References: <20261111102729.2096241-1-sw@simonwunderlich.de>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="830158"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:y81tLZbDfQr21H+0ZpKO62FSK3s= sha256:qAiRt8QJaiT5IMeJ5TNX4fnxpsr/+d/K9JvtljYISWQ=
	sha1:fSWUZlMmUH++C4YLj1yrajVx9w0= sha256:ADhMoydoWnjhiGLLo3flTsIKvaUOexJJptCI7DdS6eM=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 8B26E113EA7; Wed, 11 Nov 2026 13:29:18 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=simonwunderlich.de
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id sWgxhMA7aDdc;
	Wed, 11 Nov 2026 13:29:15 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-361000-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=simonwunderlich.de
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id C8374113E9B; Wed, 11 Nov 2026 13:29:06 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id D02422D3E1; Wed, 11 Nov 2026 10:28:16 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794392864;
	b=l9ZyhBPdzcbAq0RaEsBvhLwxqk0PpBNN00O0gmFx5UoOno96NjQm43g9lCx3fgj8L77/
	 EgR352QYdbkGBBQdhbiYZ5wjrrAAmO9txn0w/QUTB92wPnX/SR3z47ctUHpajku9NTW7z
	 m0c+ZxURlERa77fRCmmtgOkKANBjcYs5y+ow/Qyp3+MKmxS7LregUaLa6o+lCbM7ggVzD
	 tKN0dNATYWtoVz84nEAE0LePSq8b2UcmocFWObeQNOKH0L6C+WxqzE5i85LL735zbdbIi
	 syk8CpUsHBRfF2xvF83aildOqtjgbWlUxuXWO5wmrX33Jk1VMEe+v0/ziAsxxNe1I4Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794392864;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:From:To:
	 Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=ZXY9RMei14Qa6qZcMDBzjNkR+zAn7SgX5Be6ZFMOjm8=;
	b=1zhdMcTf2QFahujGjxjWMBZaNMKFX7YWGWdi0SVNH7leRqXPFID4Ts41jfoV31u5h49w
	 +aBw5iOveuQ7N9dTuVuVjvHf4eUfXwKIWpoxq2yGLv8EoFcMtLG3TI5iBSSwpuF48bHgf
	 H4pbASMbN7NR/A2dJ9HpA52u81P2VweV3uEYD6NaA150S8R9fvVdKxuQkY01RIJPLvJIK
	 xXHPb9fNnh8BcSL80gQP/OxDQzIYXmTnlBcNgGSep2FlGkLHz1832bzTCX/wj6ueCeELe
	 djBquHNs7R00B9tJS9BjSlpvc5n39FPPE8Qp/JvtKZ2sVSIdQ5z0RsgIpNmgu6Va5fQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=simonwunderlich.de header.i=@simonwunderlich.de header.a=rsa-sha256 header.s=09092022 header.b=MZWbUqqY;
	dmarc=pass header.from=simonwunderlich.de;
	spf=pass smtp.mailfrom=simonwunderlich.de;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 7ECCE60A261C;
	Wed, 11 Nov 2026 10:27:44 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=simonwunderlich.de header.i=@simonwunderlich.de header.a=rsa-sha256 header.s=09092022 header.b=MZWbUqqY
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=23.88.38.48
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794392863;
	b=0hUT/BoomTA3VH+GovLFibfMVPZKgyGwFhQ8gzp2FZuYL5vkC0TVvcQGOF6rHEIm7Iv5
	 gYPuiPA5htAOJY3SDAr+Gu0c5f7MwiNS5NsYhVM0RlS7ugbJsvsvOhyHj2NdL1Xm3pwNS
	 V+tVKfwEKPZ0McrCWR7UE7xCZzh/TW02E6LhRKd2vU+DH/n/CPMcdpHCC417xhAO2fVO+
	 ldx2qHUDS2mQNtNidqjZKT4ItsPcwZ0hPweBjUXjppeA90g3FXqDZ0W6uBs/idMZrfTsr
	 INFf32MB2WzM5weZsb3rYV4gJkfObGimq8B7gwbwGjjF8D3RSLLpTDJ0fvP/jS4MM3A==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794392863;
	h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date:
	 Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding;
	bh=ZXY9RMei14Qa6qZcMDBzjNkR+zAn7SgX5Be6ZFMOjm8=;
	b=FJz6fpRXCx/hnNzYrXH8SL8KXMP1EqeBKFUSbMPO0cRsIy1ELn6ZlLUXtvvPwX9Dj/Yq
	 5C0gdjT7dfEoqGEkXTqJIY4yRSucTJnOO8DbDnqWpnH0BvKSyXlpG4Z/O5RFNTaZdwINS
	 fAbaUnIMS0ottwnAox14tFGBx6Z84wxCm8WVNNAKtT3IK1cPmWr7B2T3nSnYUpu5GE3ZQ
	 070WPrgmJINDGrgs9Aqeeev2CfVcDvOkF2MLhH+gg5LFMLj2E0WqaW3GdEFOniftlISBH
	 FxvwHcpXIfHFHtzGB1UD3bsd12r1UgmVxQSDJXP9Z6QZzeq7eXzSgXIaUbyFUHZsUVw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=simonwunderlich.de;
	spf=pass smtp.mailfrom=simonwunderlich.de;
	dkim=pass header.d=simonwunderlich.de header.i=@simonwunderlich.de header.a=rsa-sha256 header.s=09092022 header.b=MZWbUqqY;
	arc=none smtp.remote-ip=23.88.38.48
X-Received: from mail.simonwunderlich.de (mail.simonwunderlich.de [23.88.38.48])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with UTF8SMTPS id 2970D606A8B0
	for <netdev@vger.kernel.org>; Wed, 11 Nov 2026 10:27:43 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2970D606A8B0
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=simonwunderlich.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=simonwunderlich.de
X-Received: from kero.packetmixer.de (p200300C59740dEd843be7E4A980E9C65.dip0.t-ipconnect.de [IPv6:2003:c5:9740:ded8:43be:7e4a:980e:9c65])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by mail.simonwunderlich.de (Postfix) with UTF8SMTPSA id 4612BFA2EF;
	Wed, 11 Nov 2026 11:27:40 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=simonwunderlich.de;
	s=09092022; t=1794392860;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=ZXY9RMei14Qa6qZcMDBzjNkR+zAn7SgX5Be6ZFMOjm8=;
	b=MZWbUqqYR13QiKezBgP2r+m2jHP6XRE97evVzFSrx5IZlIkH10fDt01cZ6UcKUnQkg5Gv1
	ExcFwKRlpPsBdgGIfgreWdMWPA9Zj+0p1aUrL6p18YFrvZMIlWtJOmL1R56LNZTFux3vXX
	4xXog+NlCrLa68hbaAliL0mfpTMSicqLCOR12Vol8XY9DYI3b6vSEr5lKJzrAYvX0NZCDm
	dPmha3Cr7GcczHd5666ClwF6G6EMDqKIZzsAbO2vTXmdqxkUDcSbOEWd+rO+umZTQFUSkQ
	KPzBS9L4Kl5BZePIDAU4tlohUw3ECTC6TqUYFEi0/G3cA1F+lXSUmw20a0lmcg==
X-Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	b.a.t.m.a.n@lists.open-mesh.org,
	Sven Eckelmann <sven@narfation.org>,
	Simon Wunderlich <sw@simonwunderlich.de>
X-Mailer: git-send-email 2.47.3
X-In-Reply-To: <20261111102729.2096241-1-sw@simonwunderlich.de>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list