diff mbox series

[net-next] net/smc: make smc_hash_sk/smc_unhash_sk static

Message ID 20240325012501.709009-1-shaozhengchao@huawei.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net/smc: make smc_hash_sk/smc_unhash_sk static | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 944 this patch: 944
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 10 of 10 maintainers
netdev/build_clang success Errors and warnings before: 955 this patch: 955
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 955 this patch: 955
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 34 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-03-26--00-00 (tests: 943)

Commit Message

shaozhengchao March 25, 2024, 1:25 a.m. UTC
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>
---
 include/net/smc.h | 3 ---
 net/smc/af_smc.c  | 6 ++----
 2 files changed, 2 insertions(+), 7 deletions(-)

Comments

Wen Gu March 25, 2024, 2:16 a.m. UTC | #1
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
Tony Lu March 25, 2024, 3:15 a.m. UTC | #2
On Mon, Mar 25, 2024 at 09:25:01AM +0800, 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>

This patch's good. The net-next is still closed for now. You can check
here:

	https://patchwork.hopto.org/net-next.html

Tony Lu

> ---
>  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
> -- 
> 2.34.1
shaozhengchao March 25, 2024, 3:34 a.m. UTC | #3
On 2024/3/25 11:15, Tony Lu wrote:
> On Mon, Mar 25, 2024 at 09:25:01AM +0800, 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>
> 
Hi Tony:
	Thanks for the heads-up. I'll send it again until net-next open.

Zhengchao Shao

> This patch's good. The net-next is still closed for now. You can check
> here:
> 
> 	https://patchwork.hopto.org/net-next.html
> 
> Tony Lu
> 
>> ---
>>   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
>> -- 
>> 2.34.1
diff mbox series

Patch

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