From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 403EA37F304 for ; Mon, 27 Jul 2026 05:48:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785131316; cv=none; b=sJA3oGRKdXDD4ozoad2MNoW8W+qTa8JJyfunT06H7NTgGJ1YqadSyU3PNXztqVzhXyL86PFs9CNKRm/yGHGicj0ji9EI4rg02RP/x/voGP/0UKrXiixWg0Cypwbv+qLgDucWvsQ0lW1Atln1cMECtdQSglumb7cAJ0RAgBRKtvo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785131316; c=relaxed/simple; bh=jYdrv5aLTGoq6MVHdBhKqdOC5Emi1SDW6/+dotr+YZE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=ql8MKxFIf5Dj6xdn1KQGGNwc2Yc7sVjjHbGUgOn+E1Dww/NCR13TrGGR10I86XrR0809D8ybO/Tn3X+KMLPZq3gbJ0aVlNkeIroebAIpEMi4XjUO5XhN2qsMnCHEUZ3UXvrX1GTeHTrhYbzgmAco1hmNfsGae/7rL33OTElIXIU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Lz2X8XPD; arc=none smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Lz2X8XPD" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-8484f229529so1416028b3a.2 for ; Sun, 26 Jul 2026 22:48:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785131314; x=1785736114; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=+P1l48Cfs9m3W+Af7BHX+7RVWzaGG0yiwW8zKxNko4U=; b=Lz2X8XPD9+AHqeQIcC1509/bLaCOAFxFb6h0ySKu0EeVD7K6fJsOGNaOlnSl1O+Cez 5kWkP+qVoAQewHIG08koik180zPsjxAygPumuEBRg6YF26bFbFs63I24yWtWk5lC/zNP UD6vXo8mSmtxW2s5XYt6G9UULKLOo8hWlW3a2XL+RV0cEvcLnjv2EbqYTtwdT7+DkhVw 5psKigBPTecgTiQJI+KClrjrOX1cGeeR8iNU+FKLhs+wENm+aLEwG4gVFD6TcLMriIPQ uTRPEr+ul5ifklVmu+hC6YmU47LQAIbfy7WqqwHokthhiTphSrhIisFcyx8FLCB0pP68 oddg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785131314; x=1785736114; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=+P1l48Cfs9m3W+Af7BHX+7RVWzaGG0yiwW8zKxNko4U=; b=iAVb7FW/N4NySmFhcCMCU/YR6nq3iumYc6UP0UnPiqFQaebsTeAB7Rwq8Wz+W0luJL 4X+XlkOZ8yGK9me64epqiU4vXJWuTbX9olOlf7+OrJIIfKJRbEazBS28visvH8anm4MA IOWE7krRLtzekO6UDzzpMZLdwaKw26HYPh3Wy7tFcmyNl5G5z/mSYCGJOcOuOAPwDBUC vhy8Xai5+BRPqRd8gKn+41xcYiD95dlmDWgKgWCGKPb5SloMvpw9CLho5wWnKPZLrPph VbXnMIaDwg0+lgtx77qD2UNmdaOxzFRivzz/DgmzQJv1E9C3UwafnB+QjPBD1QNDcpIg IWFA== X-Forwarded-Encrypted: i=1; AHgh+Rp9E1y8fg4b09ucfQWhBvSuNiyhmN56Rk0JHM+1cqn8UWnAQU6IubORwsQzSN4+Q2YG4LH8tKYEaJukbUk=@vger.kernel.org X-Gm-Message-State: AOJu0Yy2/Et8tdzrByTxrLZoZHPtADm5+N+AqU1k3f4+qilonrQB9c9j D/w8Ug9Plt3vOw8PJaPdmBgbECLnuo06OGAjE6Plm6SdYJ3OP8IASaeFcViGGiOi X-Gm-Gg: AR+sD13r5ACfJHJ8KRa7+mUEtnEWiXkEvCNZvjAhIcLJZOZUisRLTsjsYhPCIA09CaQ xY7ai2/w3aSSrPxJDRAvpHa9XyP186oYs+3SwF/6tSLaBIDecDmi+DiSplARPCDr8kNuwOflClG 7TfHdzl1nU6Nd6vLG8hHZ4rbaXh4hbJccD6VYlnaf8sdyZfore104maOoXkJ41rS1UlhPb+EkY2 jSrWzBSoUoNLt5i3ptivkdYK12dVZDQCWlPYepSqnE2C5wfKqWIB+aGO72rh56moEOrpYVF1g/K 8FBsjYVV7cnUwVQoKOe5I/KIw9TvyGUFOeOuW6KQbIw4KDscjqFCTgbA31gqNfupMfBUcjO8FLS Ti0XDjnWrnZXSCgKiXISThoNiD+wiEvR4T9BWTKz5IBAGl/I9yhfy7iXtcEge6GwMyEkUD+H7uI TZy6G7moDeXH0= X-Received: by 2002:aa7:88c9:0:b0:848:6dd1:8195 with SMTP id d2e1a72fcca58-84e5947debfmr5484549b3a.34.1785131314448; Sun, 26 Jul 2026 22:48:34 -0700 (PDT) Received: from gmail.com ([140.123.97.71]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84e5346dc8bsm2514476b3a.61.2026.07.26.22.48.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jul 2026 22:48:34 -0700 (PDT) From: ArBin 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 Subject: [PATCH net-next] atm: remove unused exported helpers Date: Mon, 27 Jul 2026 13:45:38 +0800 Message-Id: <20260727054538.196437-1-eric91102091@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Xiang-Bin Shi 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 --- 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 -#include - -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 #include #include -#include #include #include #include @@ -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