Skip to contentSkip to conversation

lockd: Make two symbols static

PATCH In review YueHaibing 4 participants 4 messages May 28, 2019

Subsystems (2)
lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 lockd: Make two symbols static

Fix sparse warnings:

fs/lockd/clntproc.c:57:6: warning: symbol 'nlmclnt_put_lockowner' was not declared. Should it be static? fs/lockd/svclock.c:409:35: warning: symbol 'nlmsvc_lock_ops' was not declared. Should it be static?

---
 fs/lockd/clntproc.c | 2 +-
 fs/lockd/svclock.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
fs/lockd/clntproc.c +1 -1
index 0ff8ad4..b11f2af 100644
@@ -54,7 +54,7 @@ nlmclnt_get_lockowner(struct nlm_lockowner *lockowner)
 	return lockowner;
 }
 
-void nlmclnt_put_lockowner(struct nlm_lockowner *lockowner)
+static void nlmclnt_put_lockowner(struct nlm_lockowner *lockowner)
 {
 	if (!refcount_dec_and_lock(&lockowner->count, &lockowner->host->h_lock))
 		return;
fs/lockd/svclock.c +1 -1
index 5f9f19b..61d3cc2 100644
@@ -406,7 +406,7 @@ static void nlmsvc_locks_release_private(struct file_lock *fl)
 	nlmsvc_put_lockowner((struct nlm_lockowner *)fl->fl_owner);
 }
 
-const struct file_lock_operations nlmsvc_lock_ops = {
+static const struct file_lock_operations nlmsvc_lock_ops = {
 	.fl_copy_lock = nlmsvc_locks_copy_lock,
 	.fl_release_private = nlmsvc_locks_release_private,
 };
Signature · 1 line
2.7.4
#1 lore raw

Maintainers, what's the best thing to do here: fold these into another patch version and post it (add attribution)? Add it as another patch at the end of the series?

I have learned my lesson: add sparse to my workflow.

Ben

Quoted 43 lines · YueHaibing

Fix sparse warnings:

fs/lockd/clntproc.c:57:6: warning: symbol 'nlmclnt_put_lockowner' was not declared. Should it be static? fs/lockd/svclock.c:409:35: warning: symbol 'nlmsvc_lock_ops' was not declared. Should it be static?

---
 fs/lockd/clntproc.c | 2 +-
 fs/lockd/svclock.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
fs/lockd/clntproc.c +1 -1
index 0ff8ad4..b11f2af 100644
@@ -54,7 +54,7 @@ nlmclnt_get_lockowner(struct nlm_lockowner 
 *lockowner)
 	return lockowner;
 }
 
-void nlmclnt_put_lockowner(struct nlm_lockowner *lockowner)
+static void nlmclnt_put_lockowner(struct nlm_lockowner *lockowner)
 {
 	if (!refcount_dec_and_lock(&lockowner->count, 

&lockowner->host->h_lock))

fs/lockd/clntproc.c +0 -0
 		return;
fs/lockd/svclock.c +1 -1
index 5f9f19b..61d3cc2 100644
@@ -406,7 +406,7 @@ static void nlmsvc_locks_release_private(struct 
 file_lock *fl)
 	nlmsvc_put_lockowner((struct nlm_lockowner *)fl->fl_owner);
 }
 
-const struct file_lock_operations nlmsvc_lock_ops = {
+static const struct file_lock_operations nlmsvc_lock_ops = {
 	.fl_copy_lock = nlmsvc_locks_copy_lock,
 	.fl_release_private = nlmsvc_locks_release_private,

};

Signature · 1 line
2.7.4
#2 lore raw
Quoted 3 lines · Benjamin Coddington

Maintainers, what's the best thing to do here: fold these into another patch version and post it (add attribution)? Add it as another patch at the end of the series?

Either would be fine. Yeah, if it was folded in then we'd add a line like

[[email protected]: make symbols static to fix sparse warnings]

But I'll probably just add it on to the end for now. No need for you to do anything.

Quoted 1 line

I have learned my lesson: add sparse to my workflow.

I dunno, I wonder if we're better off just leaving it to this CI bot. It seems like a more efficient use of time overall than making every contributor run it.

--b.

Quoted 49 lines

Ben

Quoted 45 lines · YueHaibing

Fix sparse warnings:

fs/lockd/clntproc.c:57:6: warning: symbol 'nlmclnt_put_lockowner' was not declared. Should it be static? fs/lockd/svclock.c:409:35: warning: symbol 'nlmsvc_lock_ops' was not declared. Should it be static?

---
fs/lockd/clntproc.c | 2 +-
fs/lockd/svclock.c | 2 +-

2 files changed, 2 insertions(+), 2 deletions(-)
fs/lockd/clntproc.c +1 -1
index 0ff8ad4..b11f2af 100644
@@ -54,7 +54,7 @@ nlmclnt_get_lockowner(struct nlm_lockowner
 *lockowner)
 	return lockowner;
 }
 
-void nlmclnt_put_lockowner(struct nlm_lockowner *lockowner)
+static void nlmclnt_put_lockowner(struct nlm_lockowner *lockowner)
 {
 	if (!refcount_dec_and_lock(&lockowner->count,

&lockowner->host->h_lock))

		return;
fs/lockd/svclock.c +1 -1
index 5f9f19b..61d3cc2 100644
@@ -406,7 +406,7 @@ static void
 nlmsvc_locks_release_private(struct file_lock *fl)
 	nlmsvc_put_lockowner((struct nlm_lockowner *)fl->fl_owner);
 }
 
-const struct file_lock_operations nlmsvc_lock_ops = {
+static const struct file_lock_operations nlmsvc_lock_ops = {
 	.fl_copy_lock = nlmsvc_locks_copy_lock,
 	.fl_release_private = nlmsvc_locks_release_private,

};

Signature · 1 line
2.7.4
#3 lore raw
Quoted 14 lines · J. Bruce Fields
Quoted 3 lines · Benjamin Coddington

Maintainers, what's the best thing to do here: fold these into another patch version and post it (add attribution)? Add it as another patch at the end of the series?

Either would be fine. Yeah, if it was folded in then we'd add a line like

[[email protected]: make symbols static to fix sparse warnings]

Quoted 8 lines

But I'll probably just add it on to the end for now. No need for you to do anything.

Quoted 1 line

I have learned my lesson: add sparse to my workflow.

I dunno, I wonder if we're better off just leaving it to this CI bot. It seems like a more efficient use of time overall than making every contributor run it.

Occasionally sparse can catch a real problem that breaks bisectability. Better to do this kind of checking early, and ensure that you test those sparse-fixed bits.

--
Chuck Lever