linux-sctp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xin Long <lucien.xin@gmail.com>
To: Christoph Hellwig <hch@lst.de>
Cc: marcelo.leitner@gmail.com, davem@davemloft.net,
	edumazet@google.com,  kuba@kernel.org, pabeni@redhat.com,
	horms@kernel.org,  linux-sctp@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH] sctp: mark sctp_do_peeloff static
Date: Mon, 26 May 2025 14:25:45 -0400	[thread overview]
Message-ID: <CADvbK_d-dhZB-j9=PtCtsnvdmx980n7m8hEDrPnv+h6g7ijF-w@mail.gmail.com> (raw)
In-Reply-To: <20250526054745.2329201-1-hch@lst.de>

On Mon, May 26, 2025 at 1:47 AM Christoph Hellwig <hch@lst.de> wrote:
>
> sctp_do_peeloff is only used inside of net/sctp/socket.c,
> so mark it static.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  include/net/sctp/sctp.h | 2 --
>  net/sctp/socket.c       | 4 ++--
>  2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
> index d8da764cf6de..e96d1bd087f6 100644
> --- a/include/net/sctp/sctp.h
> +++ b/include/net/sctp/sctp.h
> @@ -364,8 +364,6 @@ sctp_assoc_to_state(const struct sctp_association *asoc)
>  /* Look up the association by its id.  */
>  struct sctp_association *sctp_id2assoc(struct sock *sk, sctp_assoc_t id);
>
> -int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id, struct socket **sockp);
> -
>  /* A macro to walk a list of skbs.  */
>  #define sctp_skb_for_each(pos, head, tmp) \
>         skb_queue_walk_safe(head, pos, tmp)
> diff --git a/net/sctp/socket.c b/net/sctp/socket.c
> index 53725ee7ba06..da048e386476 100644
> --- a/net/sctp/socket.c
> +++ b/net/sctp/socket.c
> @@ -5627,7 +5627,8 @@ static int sctp_getsockopt_autoclose(struct sock *sk, int len, char __user *optv
>  }
>
>  /* Helper routine to branch off an association to a new socket.  */
> -int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id, struct socket **sockp)
> +static int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id,
> +               struct socket **sockp)
>  {
>         struct sctp_association *asoc = sctp_id2assoc(sk, id);
>         struct sctp_sock *sp = sctp_sk(sk);
> @@ -5675,7 +5676,6 @@ int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id, struct socket **sockp)
>
>         return err;
>  }
> -EXPORT_SYMBOL(sctp_do_peeloff);
>
I believe sctp_do_peeloff() was exported specifically to allow usage
outside of the core SCTP code. See:

commit 0343c5543b1d3ffa08e6716d82afb62648b80eba
Author: Benjamin Poirier <benjamin.poirier@gmail.com>
Date:   Thu Mar 8 05:55:58 2012 +0000

    sctp: Export sctp_do_peeloff

While there’s no known in-tree usage beyond SCTP itself, we can’t be
sure whether this function has been used by out-of-tree kernel modules.

  reply	other threads:[~2025-05-26 18:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-26  5:47 [PATCH] sctp: mark sctp_do_peeloff static Christoph Hellwig
2025-05-26 18:25 ` Xin Long [this message]
2025-05-26 19:38   ` Benjamin Poirier
2025-05-27 14:23     ` Xin Long
2025-05-28 12:04       ` David Laight
2025-05-28  1:40 ` patchwork-bot+netdevbpf

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='CADvbK_d-dhZB-j9=PtCtsnvdmx980n7m8hEDrPnv+h6g7ijF-w@mail.gmail.com' \
    --to=lucien.xin@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hch@lst.de \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).