🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #22088

Re: [PATCH net-next 01/15] batman-adv: document refcount of returned objects

#22088
From: Sven Eckelmann
Date: Tue, 24 Nov 2026 21:11
134 lines
13957 bytes
--nextPart15895148.tv2OnDr8pf
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="utf-8"; protected-headers="v1"
From: Sven Eckelmann <sven@narfation.org>
To: sw@simonwunderlich.de, netdev-bot+sashiko@kernel.org
Date: Tue, 24 Nov 2026 22:11:07 +0100
Message-ID: <2939196.BEx9A2HvPv@sven-desktop>
In-Reply-To: <179554083742.3135.4885971613759489815@kernel.org>
MIME-Version: 1.0

On Tuesday, 24 November 2026 18:20:37 CET netdev-bot+sashiko@kernel.org wrote:
> Earlier, the message gives "(with increased refcnt)" as an example of
> wording that already documents this. The diff then removes that wording
> and rewrites it in batadv_gw_get_selected_gw_node(),
> batadv_gw_get_selected_orig(), batadv_hardif_get_by_netdev(),
> batadv_primary_if_get_selected(), batadv_orig_hash_find() and all of the
> netlink.c getters.
> 
> The same happens to "with an initialized reference counter" in
> batadv_tt_local_create() and batadv_tt_global_create(). It also happens to
> "it with an increased refcounter" in batadv_tt_global_orig_entry_find().
> 
> On the other hand, the other existing phrasing is left alone:
> 
>     * The object is returned with refcounter increased by 1.
> 
> It is still in batadv_orig_node_vlan_new(), batadv_orig_router_get(),
> batadv_orig_ifinfo_get(), batadv_orig_ifinfo_new(),
> batadv_neigh_ifinfo_get(), batadv_neigh_ifinfo_new() and
> batadv_last_bonding_get().


Will sync the remaining kernel-doc in a follow up patch: 

diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 25a3f78aca1a73cb484cfa038c0cd9151bc77d74..917bdbdd276a3a256f7d9778ea2fb9551fd5e62c 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -165,8 +165,7 @@ static bool batadv_vlan_id_valid(unsigned short vid)
  * Return: NULL in case of failure or the vlan object identified by vid and
  * belonging to orig_node otherwise. The object is created and added to the list
  * if it does not exist.
- *
- * The object is returned with refcounter increased by 1.
+ * The returned object has an increased refcounter.
  */
 struct batadv_orig_node_vlan *
 batadv_orig_node_vlan_new(struct batadv_orig_node *orig_node,
@@ -313,8 +312,7 @@ void batadv_neigh_node_release(struct kref *ref)
  *  the OGM should be sent to
  *
  * Return: the neighbor which should be the router for this orig_node/iface.
- *
- * The object is returned with refcounter increased by 1.
+ * The returned object has an increased refcounter.
  */
 struct batadv_neigh_node *
 batadv_orig_router_get(struct batadv_orig_node *orig_node,
@@ -373,8 +371,7 @@ batadv_orig_to_router(struct batadv_priv *bat_priv, const u8 *orig_addr,
  * @if_outgoing: the interface for which the ifinfo should be acquired
  *
  * Return: the requested orig_ifinfo or NULL if not found.
- *
- * The object is returned with refcounter increased by 1.
+ * The returned object has an increased refcounter.
  */
 struct batadv_orig_ifinfo *
 batadv_orig_ifinfo_get(struct batadv_orig_node *orig_node,
@@ -408,8 +405,7 @@ batadv_orig_ifinfo_get(struct batadv_orig_node *orig_node,
  * Return: NULL in case of failure or the orig_ifinfo object for the if_outgoing
  * interface otherwise. The object is created and added to the list
  * if it does not exist.
- *
- * The object is returned with refcounter increased by 1.
+ * The returned object has an increased refcounter.
  */
 struct batadv_orig_ifinfo *
 batadv_orig_ifinfo_new(struct batadv_orig_node *orig_node,
@@ -451,9 +447,8 @@ batadv_orig_ifinfo_new(struct batadv_orig_node *orig_node,
  * @neigh: the neigh node to be queried
  * @if_outgoing: the interface for which the ifinfo should be acquired
  *
- * The object is returned with refcounter increased by 1.
- *
- * Return: the requested neigh_ifinfo or NULL if not found
+ * Return: the requested neigh_ifinfo or NULL if not found.
+ * The returned object has an increased refcounter.
  */
 struct batadv_neigh_ifinfo *
 batadv_neigh_ifinfo_get(struct batadv_neigh_node *neigh,
@@ -487,8 +482,7 @@ batadv_neigh_ifinfo_get(struct batadv_neigh_node *neigh,
  * Return: NULL in case of failure or the neigh_ifinfo object for the
  * if_outgoing interface otherwise. The object is created and added to the list
  * if it does not exist.
- *
- * The object is returned with refcounter increased by 1.
+ * The returned object has an increased refcounter.
  */
 struct batadv_neigh_ifinfo *
 batadv_neigh_ifinfo_new(struct batadv_neigh_node *neigh,
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 821fb5addbfe1dafa8a43e3ccf03032b4c5d8b16..73d9217afd1f29f5c7a0605cbf0a4cf94c8055c7 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -538,9 +538,8 @@ static int batadv_check_unicast_packet(struct batadv_priv *bat_priv,
  * batadv_last_bonding_get() - Get last_bonding_candidate of orig_node
  * @orig_node: originator node whose last bonding candidate should be retrieved
  *
- * Return: last bonding candidate of router or NULL if not found
- *
- * The object is returned with refcounter increased by 1.
+ * Return: last bonding candidate of router or NULL if not found.
+ * The returned object has an increased refcounter.
  */
 static struct batadv_orig_ifinfo * __must_check
 batadv_last_bonding_get(struct batadv_orig_node *orig_node)

Regards,
	Sven
--nextPart15895148.tv2OnDr8pf
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQS81G/PswftH/OW8cVND3cr0xT1ywUCawX9awAKCRBND3cr0xT1
y2CjAQCex3cOcPX3MfgI/UtuLP2yyWuXL9UBoTVAuIaPuHWHVwD/RSvamYy87WCZ
dDbg5rreYWNBTetQ6jYJ/sTtvH7Iugs=
=F+iV
-----END PGP SIGNATURE-----

--nextPart15895148.tv2OnDr8pf--
Technical Details
Message-ID: <2939196.BEx9A2HvPv@sven-desktop>
Path: mbox-mo1.pugleaf.net!news-sfo.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370764-linux-kernel-netdev=dewy.ru
References: <20261123171827.3294525-2-sw@simonwunderlich.de> <179554083742.3135.4885971613759489815@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-sfo.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370764-linux-kernel-netdev=dewy.ru
From: sven@narfation.org (Sven Eckelmann)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 01/15] batman-adv: document refcount of returned objects
Date: Tue, 24 Nov 2026 22:11:07 +0100
Organization: Usenet Network
Message-ID: <2939196.BEx9A2HvPv@sven-desktop>
References: <20261123171827.3294525-2-sw@simonwunderlich.de>
 <179554083742.3135.4885971613759489815@kernel.org>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart15895148.tv2OnDr8pf";
 micalg="pgp-sha512"; protocol="application/pgp-signature"
Injection-Info: usenet.network;
	logging-data="39726"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:WJ8KLWGcu5Gsjl+bgKcnR+fx5uI= sha256:KfUurRSUPtJuljZXHY0Pl7Z/OuN2OjFX1kH0ixRCs68=
	sha1:eOobk2kxYXd84SACoU/+oxtV4EA= sha256:XV8W+bFe80rq+vcKpoCDzGRmO9uOWcHXFBczYznfoS8=
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 A502D125E2E; Wed, 25 Nov 2026 00:11:28 +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 (1024-bit key)
	header.d=narfation.org
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 ZqgDtJ0r_cLG;
	Wed, 25 Nov 2026 00:11:25 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370764-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=narfation.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id B2B3A125D85; Wed, 25 Nov 2026 00:11:16 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 0B44927A4B; Tue, 24 Nov 2026 21:11:15 +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=1795554674;
	b=LUKV9FXyV1NoGnbBR2qiPncvvmp4akpksgi9dEycXGwt9i7UxjHWFAPOIb6os/2p1lfi
	 cbRBG3xb9u+LrcATjSjlJ4WHHj4iBirci/xDswG44NcYuqZYFutGt9Oa8f/Sez/190J4p
	 a4NwIu6+qaGOEnYuNaMoCCgLBshV/mKajPTspaxaGLvKfovyvZlLUwdtMr2L6ahgDKz/1
	 Rl7u9KneF3UiDbtHpzT2nROUbIGPJ8ZieRtJRobv7vffgMcyDC5jTLFBYii7Bb/vYEqgd
	 o+i8hCU8nzoUklswH06MgId9qvZq7HDcqcZJrPVm52JfUpWXZgLRQxS3FatA8E75/Pg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795554674;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:From:To:
	 Cc:Subject:Date:Message-ID:In-Reply-To:References:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Type;
	bh=G3HX/NcDKYG/LV94s9yi5wM3im9Q7+MV9lfJBW3/vZU=;
	b=PLJ2ZitwAJuoVGSKN6wL1hKz1PzQugN9cQnMsXiWulsiKsV5PwcSOiv94HnXTZxs/alK
	 34FLtP1715NdnCxDTwC8jf7C9A/hPjPAlMY8Zh7zkej49OdwauihW1+q0J27u4hJ1JBOh
	 8H/MpjQrb98Kv/8sQOhTgJqvjh3EILM2ySEzItm2++qSXqSkeWfH4JaynVQNjoQhB0ab8
	 boZSBF/sKD+CTk/Sz6UyY0Boyn1J4+ca1nDl8kzkCjmn17illUHNRGo788eXHmMAyl9Ko
	 gZ0CnAuhHNXRmMVmZZT7NlK1wcJ3LByRBpC2RtN8CSYpk9tCC+SJiOm7biNJmmFsixQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=narfation.org header.i=@narfation.org header.a=rsa-sha256 header.s=20121 header.b="vJw/GS2u";
	dmarc=pass header.from=narfation.org;
	spf=pass smtp.mailfrom=narfation.org;
	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 C8005606A326;
	Tue, 24 Nov 2026 21:11:14 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=narfation.org header.i=@narfation.org header.a=rsa-sha256 header.s=20121 header.b=vJw/GS2u
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=213.160.73.56
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795554674;
	b=DxcBT99faZWeO0sXEvPebtXjqNTXk0iM60N7Z87E+3TRP9dBCVPS86JODDsi7qm4CH1Y
	 oCeiAOQeE5SZrbIKJNJDEkelzLx/lSOtqxfUPz6cVUar2ktUAeMCUHhl0F9dfNPQDlw5q
	 8SzDeXUoGwkwtwiUORz2FK+NgC76JWvlr9eefQ8da+cBjXueq07seoejBbKCTJgjrn0CB
	 p3REPTMEfYDglAGtLud+8EI0XGvyCEY3rprtFQSykOMQovXmszvMabzbu1Tqn2RnDTkVa
	 cPhSqcELYe7NceylpE5NblHvmK05RKnRbwHfsZBEVhRgv7yJ+jDuguZ98luL+Lz1lNQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795554674;
	h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date:
	 Message-ID:In-Reply-To:References:MIME-Version:Content-Type;
	bh=G3HX/NcDKYG/LV94s9yi5wM3im9Q7+MV9lfJBW3/vZU=;
	b=vCbk3reAzM+lc1ZxKjNqotLEQl3lD4SpjPnBEMqJX44S3kbHXXSOfxr6KwdZYHJKdz/x
	 BsJmZm2ohCYgds1SWt0PRBze//hzRkjJtOD4HqWZTFd1fozIuYAy+k/AgNdcprDT2zfLf
	 4DErZfml/JyzE7qTvDi9BJc1aMnXISgXpwW5v52jU+TqNvUR/Hg1k2FKTjii+V9uTdyQU
	 LZ9N9A1glTFn1K99aFJtyOZZuG55Fp1ArtTrSIPMwwNJ39eF4f1hvaZF5s/CGfP14awfO
	 oUu5RKHloMt1wvcAXEKL2cjybjmjWTLQdI3xaycrR9dfYH7c14YmNgqSDx8x8pz92CA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=narfation.org;
	spf=pass smtp.mailfrom=narfation.org;
	dkim=pass header.d=narfation.org header.i=@narfation.org header.a=rsa-sha256 header.s=20121 header.b="vJw/GS2u";
	arc=none smtp.remote-ip=213.160.73.56
X-Received: from dvalin.narfation.org (dvalin.narfation.org [213.160.73.56])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73F80606A31E
	for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 21:11:12 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 73F80606A31E
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=narfation.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=narfation.org
X-Received: by dvalin.narfation.org (Postfix) id 5A49120277;
	Tue, 24 Nov 2026 21:11:10 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org;
	s=20121; t=1795554670;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=G3HX/NcDKYG/LV94s9yi5wM3im9Q7+MV9lfJBW3/vZU=;
	b=vJw/GS2uQ4vBOXvdZwwq6T6DsFagtRiFFeQinhjDYKxfBZrtbFzt/OoVmmyvKxjdBRX/Pt
	kCntGUbA15sGVBbHZNSV2s5tR55pZjVMnJkiaVBiYNPtRrTbooDPVilJmJnpeuoqPdvkRR
	rK6z6u1+A2i8BWd5msYsdtpGQMIHuuc=
X-Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
 kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
 b.a.t.m.a.n@lists.open-mesh.org
X-In-Reply-To: <179554083742.3135.4885971613759489815@kernel.org>
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