Skip to contentSkip to conversation

lockd: host: Remove unnecessary statements'host = NULL;'

PATCH In review Li kunyu 3 participants 3 messages Apr 17, 2024

Subsystems (2)
lore
Share & tools
lore

Li kunyu

author
#0 lore raw

PATCH 1/1 lockd: host: Remove unnecessary statements'host = NULL;'

In 'nlm_alloc_host', the host has already been assigned a value of NULL when defined, so 'host=NULL;' Can be deleted.

---
 fs/lockd/host.c | 1 -
 1 file changed, 1 deletion(-)
fs/lockd/host.c +0 -1
index 127a728fcbc81..c115168017845 100644
@@ -117,7 +117,6 @@ static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni,
 	if (nsm != NULL)
 		refcount_inc(&nsm->sm_count);
 	else {
-		host = NULL;
 		nsm = nsm_get_handle(ni->net, ni->sap, ni->salen,
 					ni->hostname, ni->hostname_len);
 		if (unlikely(nsm == NULL)) {
Signature · 1 line
2.18.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Li kunyu

In 'nlm_alloc_host', the host has already been assigned a value of NULL when defined, so 'host=NULL;' Can be deleted.

---
 fs/lockd/host.c | 1 -
 1 file changed, 1 deletion(-)
fs/lockd/host.c +0 -0
index 127a728fcbc81..c115168017845 100644

fs/lockd/host.c static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni, · line 122

Quoted 7 lines
fs/lockd/host.c +0 -1
@@ -117,7 +117,6 @@ static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni,
 	if (nsm != NULL)
 		refcount_inc(&nsm->sm_count);
 	else {
-		host = NULL;
 		nsm = nsm_get_handle(ni->net, ni->sap, ni->salen,
 					ni->hostname, ni->hostname_len);
 		if (unlikely(nsm == NULL)) {
#2 lore raw
In reply to Li kunyu
Quoted 23 lines · Li kunyu

In 'nlm_alloc_host', the host has already been assigned a value of NULL when defined, so 'host=NULL;' Can be deleted.

---
 fs/lockd/host.c | 1 -
 1 file changed, 1 deletion(-)
fs/lockd/host.c +0 -1
index 127a728fcbc81..c115168017845 100644
@@ -117,7 +117,6 @@ static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni,
 	if (nsm != NULL)
 		refcount_inc(&nsm->sm_count);
 	else {
-		host = NULL;
 		nsm = nsm_get_handle(ni->net, ni->sap, ni->salen,
 					ni->hostname, ni->hostname_len);
 		if (unlikely(nsm == NULL)) {
Signature · 1 line
2.18.2

Thanks for the clean up! Applied to nfsd-next (for v6.10).

Signature · 1 line
Chuck Lever