Netdev List
 help / color / mirror / Atom feed
From: ArBin <eric91102091@gmail.com>
To: netdev@vger.kernel.org
Cc: 3chas3@gmail.com, linux-atm-general@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	horms@kernel.org, Xiang-Bin Shi <eric91102091@gmail.com>
Subject: [PATCH net-next] atm: remove unused exported helpers
Date: Mon, 27 Jul 2026 13:45:38 +0800	[thread overview]
Message-ID: <20260727054538.196437-1-eric91102091@gmail.com> (raw)

From: Xiang-Bin Shi <eric91102091@gmail.com>

Commit 6deb53595092 ("net: remove unused ATM protocols and legacy
ATM device drivers") removed the remaining in-tree users of
atm_alloc_charge(), atm_pcr_goal(), sonet_copy_stats() and
sonet_subtract_stats().

Remove these unused exported helpers and their declarations. The
removal of the SONET statistics helpers also leaves
include/linux/sonet.h without users, so remove the internal header and
its MAINTAINERS entry.

Signed-off-by: Xiang-Bin Shi <eric91102091@gmail.com>
---
 MAINTAINERS            |  1 -
 include/linux/atmdev.h |  3 --
 include/linux/sonet.h  | 20 -----------
 net/atm/atm_misc.c     | 79 ------------------------------------------
 4 files changed, 103 deletions(-)
 delete mode 100644 include/linux/sonet.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 60cff00953dc..e7ebe79843cb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4279,7 +4279,6 @@ W:	http://linux-atm.sourceforge.net
 F:	drivers/atm/
 F:	drivers/usb/atm/
 F:	include/linux/atm*
-F:	include/linux/sonet.h
 F:	include/uapi/linux/atm*
 F:	include/uapi/linux/sonet.h
 F:	net/atm/
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index fe21d2f547b5..92c2e20e7416 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -229,9 +229,6 @@ static inline void atm_dev_put(struct atm_dev *dev)
 
 
 int atm_charge(struct atm_vcc *vcc,int truesize);
-struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size,
-    gfp_t gfp_flags);
-int atm_pcr_goal(const struct atm_trafprm *tp);
 
 void vcc_release_async(struct atm_vcc *vcc, int reply);
 
diff --git a/include/linux/sonet.h b/include/linux/sonet.h
deleted file mode 100644
index 2b802b6d12ad..000000000000
--- a/include/linux/sonet.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* sonet.h - SONET/SHD physical layer control */
-#ifndef LINUX_SONET_H
-#define LINUX_SONET_H
-
-
-#include <linux/atomic.h>
-#include <uapi/linux/sonet.h>
-
-struct k_sonet_stats {
-#define __HANDLE_ITEM(i) atomic_t i
-	__SONET_ITEMS
-#undef __HANDLE_ITEM
-};
-
-extern void sonet_copy_stats(struct k_sonet_stats *from,struct sonet_stats *to);
-extern void sonet_subtract_stats(struct k_sonet_stats *from,
-    struct sonet_stats *to);
-
-#endif
diff --git a/net/atm/atm_misc.c b/net/atm/atm_misc.c
index a30b83c1cb3f..c9d7609da184 100644
--- a/net/atm/atm_misc.c
+++ b/net/atm/atm_misc.c
@@ -7,7 +7,6 @@
 #include <linux/atm.h>
 #include <linux/atmdev.h>
 #include <linux/skbuff.h>
-#include <linux/sonet.h>
 #include <linux/bitops.h>
 #include <linux/errno.h>
 #include <linux/atomic.h>
@@ -22,81 +21,3 @@ int atm_charge(struct atm_vcc *vcc, int truesize)
 	return 0;
 }
 EXPORT_SYMBOL(atm_charge);
-
-struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc, int pdu_size,
-				 gfp_t gfp_flags)
-{
-	struct sock *sk = sk_atm(vcc);
-	int guess = SKB_TRUESIZE(pdu_size);
-
-	atm_force_charge(vcc, guess);
-	if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) {
-		struct sk_buff *skb = alloc_skb(pdu_size, gfp_flags);
-
-		if (skb) {
-			atomic_add(skb->truesize-guess,
-				   &sk->sk_rmem_alloc);
-			return skb;
-		}
-	}
-	atm_return(vcc, guess);
-	atomic_inc(&vcc->stats->rx_drop);
-	return NULL;
-}
-EXPORT_SYMBOL(atm_alloc_charge);
-
-
-/*
- * atm_pcr_goal returns the positive PCR if it should be rounded up, the
- * negative PCR if it should be rounded down, and zero if the maximum available
- * bandwidth should be used.
- *
- * The rules are as follows (* = maximum, - = absent (0), x = value "x",
- * (x+ = x or next value above x, x- = x or next value below):
- *
- *	min max pcr	result		min max pcr	result
- *	-   -   -	* (UBR only)	x   -   -	x+
- *	-   -   *	*		x   -   *	*
- *	-   -   z	z-		x   -   z	z-
- *	-   *   -	*		x   *   -	x+
- *	-   *   *	*		x   *   *	*
- *	-   *   z	z-		x   *   z	z-
- *	-   y   -	y-		x   y   -	x+
- *	-   y   *	y-		x   y   *	y-
- *	-   y   z	z-		x   y   z	z-
- *
- * All non-error cases can be converted with the following simple set of rules:
- *
- *   if pcr == z then z-
- *   else if min == x && pcr == - then x+
- *     else if max == y then y-
- *	 else *
- */
-
-int atm_pcr_goal(const struct atm_trafprm *tp)
-{
-	if (tp->pcr && tp->pcr != ATM_MAX_PCR)
-		return -tp->pcr;
-	if (tp->min_pcr && !tp->pcr)
-		return tp->min_pcr;
-	if (tp->max_pcr != ATM_MAX_PCR)
-		return -tp->max_pcr;
-	return 0;
-}
-EXPORT_SYMBOL(atm_pcr_goal);
-
-void sonet_copy_stats(struct k_sonet_stats *from, struct sonet_stats *to)
-{
-#define __HANDLE_ITEM(i) to->i = atomic_read(&from->i)
-	__SONET_ITEMS
-#undef __HANDLE_ITEM
-}
-EXPORT_SYMBOL(sonet_copy_stats);
-
-void sonet_subtract_stats(struct k_sonet_stats *from, struct sonet_stats *to)
-{
-#define __HANDLE_ITEM(i) atomic_sub(to->i, &from->i)
-	__SONET_ITEMS
-#undef __HANDLE_ITEM
-}
-EXPORT_SYMBOL(sonet_subtract_stats);
-- 
2.34.1


                 reply	other threads:[~2026-07-27  5:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260727054538.196437-1-eric91102091@gmail.com \
    --to=eric91102091@gmail.com \
    --cc=3chas3@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-atm-general@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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