Skip to contentSkip to conversation

fs/locks: Remove redundant assignment to cmd

PATCH In review Jiapeng Chong 5 participants 6 messages Mar 8, 2023 – Mar 10, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/locks: Remove redundant assignment to cmd

Variable 'cmd' set but not used.

fs/locks.c:2428:3: warning: Value stored to 'cmd' is never read.

---
 fs/locks.c | 1 -
 1 file changed, 1 deletion(-)
fs/locks.c +0 -1
index 66b4eef09db5..d82c4cacdfb9 100644
@@ -2425,7 +2425,6 @@ int fcntl_getlk64(struct file *filp, unsigned int cmd, struct flock64 *flock)
 		if (flock->l_pid != 0)
 			goto out;
 
-		cmd = F_GETLK64;
 		fl->fl_flags |= FL_OFDLCK;
 		fl->fl_owner = filp;
 	}
Signature · 1 line
2.20.1.7.g153144c
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Jiapeng Chong

Variable 'cmd' set but not used.

fs/locks.c:2428:3: warning: Value stored to 'cmd' is never read.

---
  fs/locks.c | 1 -
  1 file changed, 1 deletion(-)
fs/locks.c +0 -0
index 66b4eef09db5..d82c4cacdfb9 100644

fs/locks.c int fcntl_getlk64(struct file *filp, unsigned int cmd, struct flock64 *flock) · line 2430

Quoted 7 lines
fs/locks.c +0 -1
@@ -2425,7 +2425,6 @@ int fcntl_getlk64(struct file *filp, unsigned int cmd, struct flock64 *flock)
  		if (flock->l_pid != 0)
  			goto out;
 
-		cmd = F_GETLK64;
  		fl->fl_flags |= FL_OFDLCK;
  		fl->fl_owner = filp;
  	}

Indeed cmd is not used after this assignment in above function.

Looks good.

-ck

#2 lore raw
In reply to Jiapeng Chong

From: Christian Brauner (Microsoft) <[email protected]>

Quoted 5 lines · Jiapeng Chong

Variable 'cmd' set but not used.

fs/locks.c:2428:3: warning: Value stored to 'cmd' is never read.

Seems unused for quite a while. I've picked this up since there's a few other trivial fixes I have pending. But I'm happy to drop this if you prefer this goes via the lock tree, Jeff.

[1/1] fs/locks: Remove redundant assignment to cmd

      commit: dc592190a5543c559010e09e8130a1af3f9068d3
maintainer
#3 lore raw
Quoted 10 lines · Christian Brauner

From: Christian Brauner (Microsoft) <[email protected]>

Quoted 5 lines · Jiapeng Chong

Variable 'cmd' set but not used.

fs/locks.c:2428:3: warning: Value stored to 'cmd' is never read.

Quoted 6 lines

Seems unused for quite a while. I've picked this up since there's a few other trivial fixes I have pending. But I'm happy to drop this if you prefer this goes via the lock tree, Jeff.

[1/1] fs/locks: Remove redundant assignment to cmd

      commit: dc592190a5543c559010e09e8130a1af3f9068d3

Thanks Christian,

I had already picked it into the locks-next branch (though I didn't get a chance to reply and mention that), but I'll drop it and plan to let you carry it.

Thanks,

Signature · 1 line
Jeff Layton <[email protected]>
maintainer
#4 lore raw
Quoted 15 lines · Jeff Layton
Quoted 14 lines · Christian Brauner

From: Christian Brauner (Microsoft) <[email protected]>

Quoted 5 lines · Jiapeng Chong

Variable 'cmd' set but not used.

fs/locks.c:2428:3: warning: Value stored to 'cmd' is never read.

Seems unused for quite a while. I've picked this up since there's a few other trivial fixes I have pending. But I'm happy to drop this if you prefer this goes via the lock tree, Jeff.

Quoted 8 lines
Quoted 2 lines

[1/1] fs/locks: Remove redundant assignment to cmd

      commit: dc592190a5543c559010e09e8130a1af3f9068d3

Thanks Christian,

I had already picked it into the locks-next branch (though I didn't get a chance to reply and mention that), but I'll drop it and plan to let you carry it.

IMO that's better off in locks tree; unless Christian is planning some work in the area this cycle (I definitely do not), it's better to have it in the branch in your git - we can always pull a branch from it if needed and it's less likely to cause conflicts that way.

#5 lore raw
Quoted 21 lines · Al Viro
Quoted 20 lines · Jeff Layton
Quoted 10 lines · Christian Brauner

From: Christian Brauner (Microsoft) <[email protected]>

Quoted 5 lines · Jiapeng Chong

Variable 'cmd' set but not used.

fs/locks.c:2428:3: warning: Value stored to 'cmd' is never read.

Quoted 6 lines

Seems unused for quite a while. I've picked this up since there's a few other trivial fixes I have pending. But I'm happy to drop this if you prefer this goes via the lock tree, Jeff.

[1/1] fs/locks: Remove redundant assignment to cmd

      commit: dc592190a5543c559010e09e8130a1af3f9068d3

Thanks Christian,

Quoted 8 lines
Quoted 3 lines

I had already picked it into the locks-next branch (though I didn't get a chance to reply and mention that), but I'll drop it and plan to let you carry it.

IMO that's better off in locks tree; unless Christian is planning some work in the area this cycle (I definitely do not), it's better to have it in the branch in your git - we can always pull a branch from it if needed and it's less likely to cause conflicts that way.

I have picked up another fix for fs/locks.c for idmapped mounts so I plan on sending that with some other smaller fixes soon. (And that idmapped thing needs to be backported as well.)

So if there's non-trivial changes then I fully agree that the locking tree is absolutely the right place. Especially since Jeff will also be able to describe the changes properly and as you said we can always just pull a branch to minimize conflicts.

However, when we have simple stuff like this let's just collect it in our for *.misc trees and send it to Linus if we think enough stuff has piled up (2+?). There's no point in holding fixes like this back for a long time.

The likelihood of getting merge conflicts for smallish things that we send weekly is rather low judging from my personal experience. Stephen will tell us that quickly anyway. And even if we do get them Linus has said repeatedly that he doesn't mind fixing them so we shouldn't be fuzzed about it. Worst(/best?) case, everyone gets to watch my head being torn off...