public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Wen Gu <guwen@linux.alibaba.com>
To: Zhengchao Shao <shaozhengchao@huawei.com>,
	netdev@vger.kernel.org, linux-s390@vger.kernel.org,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com
Cc: wenjia@linux.ibm.com, jaka@linux.ibm.com,
	alibuda@linux.alibaba.com, tonylu@linux.alibaba.com,
	weiyongjun1@huawei.com, yuehaibing@huawei.com
Subject: Re: [PATCH net-next] net/smc: make smc_hash_sk/smc_unhash_sk static
Date: Mon, 25 Mar 2024 10:16:28 +0800	[thread overview]
Message-ID: <535bcbb8-c446-458b-b7d4-c13201537ad5@linux.alibaba.com> (raw)
In-Reply-To: <20240325012501.709009-1-shaozhengchao@huawei.com>



On 2024/3/25 09:25, Zhengchao Shao wrote:
> smc_hash_sk and smc_unhash_sk are only used in af_smc.c, so make them
> static and remove the output symbol. They can be called under the path
> .prot->hash()/unhash().
> 
> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>

LGTM, Thank you!

Reviewed-by: Wen Gu <guwen@linux.alibaba.com>

> ---
>   include/net/smc.h | 3 ---
>   net/smc/af_smc.c  | 6 ++----
>   2 files changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/include/net/smc.h b/include/net/smc.h
> index c9dcb30e3fd9..10684d0a33df 100644
> --- a/include/net/smc.h
> +++ b/include/net/smc.h
> @@ -26,9 +26,6 @@ struct smc_hashinfo {
>   	struct hlist_head ht;
>   };
>   
> -int smc_hash_sk(struct sock *sk);
> -void smc_unhash_sk(struct sock *sk);
> -
>   /* SMCD/ISM device driver interface */
>   struct smcd_dmb {
>   	u64 dmb_tok;
> diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
> index 4b52b3b159c0..e8dcd28a554c 100644
> --- a/net/smc/af_smc.c
> +++ b/net/smc/af_smc.c
> @@ -177,7 +177,7 @@ static struct smc_hashinfo smc_v6_hashinfo = {
>   	.lock = __RW_LOCK_UNLOCKED(smc_v6_hashinfo.lock),
>   };
>   
> -int smc_hash_sk(struct sock *sk)
> +static int smc_hash_sk(struct sock *sk)
>   {
>   	struct smc_hashinfo *h = sk->sk_prot->h.smc_hash;
>   	struct hlist_head *head;
> @@ -191,9 +191,8 @@ int smc_hash_sk(struct sock *sk)
>   
>   	return 0;
>   }
> -EXPORT_SYMBOL_GPL(smc_hash_sk);
>   
> -void smc_unhash_sk(struct sock *sk)
> +static void smc_unhash_sk(struct sock *sk)
>   {
>   	struct smc_hashinfo *h = sk->sk_prot->h.smc_hash;
>   
> @@ -202,7 +201,6 @@ void smc_unhash_sk(struct sock *sk)
>   		sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
>   	write_unlock_bh(&h->lock);
>   }
> -EXPORT_SYMBOL_GPL(smc_unhash_sk);
>   
>   /* This will be called before user really release sock_lock. So do the
>    * work which we didn't do because of user hold the sock_lock in the

  reply	other threads:[~2024-03-25  2:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25  1:25 [PATCH net-next] net/smc: make smc_hash_sk/smc_unhash_sk static Zhengchao Shao
2024-03-25  2:16 ` Wen Gu [this message]
2024-03-25  3:15 ` Tony Lu
2024-03-25  3:34   ` shaozhengchao

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=535bcbb8-c446-458b-b7d4-c13201537ad5@linux.alibaba.com \
    --to=guwen@linux.alibaba.com \
    --cc=alibuda@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jaka@linux.ibm.com \
    --cc=kuba@kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shaozhengchao@huawei.com \
    --cc=tonylu@linux.alibaba.com \
    --cc=weiyongjun1@huawei.com \
    --cc=wenjia@linux.ibm.com \
    --cc=yuehaibing@huawei.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