linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/locks: Remove redundant assignment to cmd
@ 2023-03-08  7:13 Jiapeng Chong
  2023-03-09  1:01 ` Chaitanya Kulkarni
  2023-03-09  9:25 ` Christian Brauner
  0 siblings, 2 replies; 6+ messages in thread
From: Jiapeng Chong @ 2023-03-08  7:13 UTC (permalink / raw)
  To: viro
  Cc: brauner, jlayton, chuck.lever, linux-fsdevel, linux-kernel,
	Jiapeng Chong, Abaci Robot

Variable 'cmd' set but not used.

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

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4439
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 fs/locks.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/locks.c b/fs/locks.c
index 66b4eef09db5..d82c4cacdfb9 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -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;
 	}
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] fs/locks: Remove redundant assignment to cmd
  2023-03-08  7:13 [PATCH] fs/locks: Remove redundant assignment to cmd Jiapeng Chong
@ 2023-03-09  1:01 ` Chaitanya Kulkarni
  2023-03-09  9:25 ` Christian Brauner
  1 sibling, 0 replies; 6+ messages in thread
From: Chaitanya Kulkarni @ 2023-03-09  1:01 UTC (permalink / raw)
  To: Jiapeng Chong, viro@zeniv.linux.org.uk
  Cc: brauner@kernel.org, jlayton@kernel.org, chuck.lever@oracle.com,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Abaci Robot

On 3/7/23 23:13, Jiapeng Chong wrote:
> Variable 'cmd' set but not used.
>
> fs/locks.c:2428:3: warning: Value stored to 'cmd' is never read.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4439
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>   fs/locks.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/fs/locks.c b/fs/locks.c
> index 66b4eef09db5..d82c4cacdfb9 100644
> --- a/fs/locks.c
> +++ b/fs/locks.c
> @@ -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.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fs/locks: Remove redundant assignment to cmd
  2023-03-08  7:13 [PATCH] fs/locks: Remove redundant assignment to cmd Jiapeng Chong
  2023-03-09  1:01 ` Chaitanya Kulkarni
@ 2023-03-09  9:25 ` Christian Brauner
  2023-03-09 11:50   ` Jeff Layton
  1 sibling, 1 reply; 6+ messages in thread
From: Christian Brauner @ 2023-03-09  9:25 UTC (permalink / raw)
  To: jlayton, Jiapeng Chong
  Cc: Christian Brauner, viro, chuck.lever, linux-fsdevel, linux-kernel,
	Abaci Robot

From: Christian Brauner (Microsoft) <brauner@kernel.org>


On Wed, 08 Mar 2023 15:13:16 +0800, Jiapeng Chong wrote:
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fs/locks: Remove redundant assignment to cmd
  2023-03-09  9:25 ` Christian Brauner
@ 2023-03-09 11:50   ` Jeff Layton
  2023-03-10  3:40     ` Al Viro
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Layton @ 2023-03-09 11:50 UTC (permalink / raw)
  To: Christian Brauner, Jiapeng Chong
  Cc: viro, chuck.lever, linux-fsdevel, linux-kernel, Abaci Robot

On Thu, 2023-03-09 at 10:25 +0100, Christian Brauner wrote:
> From: Christian Brauner (Microsoft) <brauner@kernel.org>
> 
> 
> On Wed, 08 Mar 2023 15:13:16 +0800, Jiapeng Chong wrote:
> > 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

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,
-- 
Jeff Layton <jlayton@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fs/locks: Remove redundant assignment to cmd
  2023-03-09 11:50   ` Jeff Layton
@ 2023-03-10  3:40     ` Al Viro
  2023-03-10  8:52       ` Christian Brauner
  0 siblings, 1 reply; 6+ messages in thread
From: Al Viro @ 2023-03-10  3:40 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Christian Brauner, Jiapeng Chong, chuck.lever, linux-fsdevel,
	linux-kernel, Abaci Robot

On Thu, Mar 09, 2023 at 06:50:15AM -0500, Jeff Layton wrote:
> On Thu, 2023-03-09 at 10:25 +0100, Christian Brauner wrote:
> > From: Christian Brauner (Microsoft) <brauner@kernel.org>
> > 
> > 
> > On Wed, 08 Mar 2023 15:13:16 +0800, Jiapeng Chong wrote:
> > > 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
> 
> 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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fs/locks: Remove redundant assignment to cmd
  2023-03-10  3:40     ` Al Viro
@ 2023-03-10  8:52       ` Christian Brauner
  0 siblings, 0 replies; 6+ messages in thread
From: Christian Brauner @ 2023-03-10  8:52 UTC (permalink / raw)
  To: Al Viro
  Cc: Jeff Layton, Jiapeng Chong, chuck.lever, linux-fsdevel,
	linux-kernel, Abaci Robot

On Fri, Mar 10, 2023 at 03:40:16AM +0000, Al Viro wrote:
> On Thu, Mar 09, 2023 at 06:50:15AM -0500, Jeff Layton wrote:
> > On Thu, 2023-03-09 at 10:25 +0100, Christian Brauner wrote:
> > > From: Christian Brauner (Microsoft) <brauner@kernel.org>
> > > 
> > > 
> > > On Wed, 08 Mar 2023 15:13:16 +0800, Jiapeng Chong wrote:
> > > > 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
> > 
> > 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.

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...

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-10  9:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-08  7:13 [PATCH] fs/locks: Remove redundant assignment to cmd Jiapeng Chong
2023-03-09  1:01 ` Chaitanya Kulkarni
2023-03-09  9:25 ` Christian Brauner
2023-03-09 11:50   ` Jeff Layton
2023-03-10  3:40     ` Al Viro
2023-03-10  8:52       ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).