All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ocfs2: delete double assignment
@ 2014-07-28 15:26 ` Himangi Saraogi
  0 siblings, 0 replies; 4+ messages in thread
From: Himangi Saraogi @ 2014-07-28 15:26 UTC (permalink / raw
  To: Mark Fasheh, Joel Becker, ocfs2-devel, linux-kernel; +Cc: julia.lawall

Delete successive assignments to the same location. The two assignments are
simply identical.

A simplified version of Coccinelle semantic match that finds this problem is as
follows:

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
---
Should the fist assignment be initializing the pv_minor field?
 fs/ocfs2/stack_user.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c
index 13a8537..4bcbb9b 100644
--- a/fs/ocfs2/stack_user.c
+++ b/fs/ocfs2/stack_user.c
@@ -591,7 +591,6 @@ static int ocfs2_control_release(struct inode *inode, struct file *file)
 		 */
 		ocfs2_control_this_node = -1;
 		running_proto.pv_major = 0;
-		running_proto.pv_major = 0;
 	}
 
 out:
-- 
1.9.1


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

* [Ocfs2-devel] [PATCH] ocfs2: delete double assignment
@ 2014-07-28 15:26 ` Himangi Saraogi
  0 siblings, 0 replies; 4+ messages in thread
From: Himangi Saraogi @ 2014-07-28 15:26 UTC (permalink / raw
  To: Mark Fasheh, Joel Becker, ocfs2-devel, linux-kernel; +Cc: julia.lawall

Delete successive assignments to the same location. The two assignments are
simply identical.

A simplified version of Coccinelle semantic match that finds this problem is as
follows:

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
---
Should the fist assignment be initializing the pv_minor field?
 fs/ocfs2/stack_user.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c
index 13a8537..4bcbb9b 100644
--- a/fs/ocfs2/stack_user.c
+++ b/fs/ocfs2/stack_user.c
@@ -591,7 +591,6 @@ static int ocfs2_control_release(struct inode *inode, struct file *file)
 		 */
 		ocfs2_control_this_node = -1;
 		running_proto.pv_major = 0;
-		running_proto.pv_major = 0;
 	}
 
 out:
-- 
1.9.1

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

* Re: [Ocfs2-devel] [PATCH] ocfs2: delete double assignment
  2014-07-28 15:26 ` [Ocfs2-devel] " Himangi Saraogi
@ 2014-08-21 21:58   ` Andrew Morton
  -1 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2014-08-21 21:58 UTC (permalink / raw
  To: Himangi Saraogi
  Cc: Mark Fasheh, Joel Becker, ocfs2-devel, linux-kernel, julia.lawall

On Mon, 28 Jul 2014 20:56:32 +0530 Himangi Saraogi <himangi774@gmail.com> wrote:

> Delete successive assignments to the same location. The two assignments are
> simply identical.
> 
> A simplified version of Coccinelle semantic match that finds this problem is as
> follows:
> 
> // <smpl>
> @@
> expression i;
> @@
> 
> *i = ...;
>  i = ...;
> // </smpl>
> 
> Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
> ---
> Should the fist assignment be initializing the pv_minor field?

I'd say so, yes.


From: Andrew Morton <akpm@linux-foundation.org>
Subject: fs/ocfs2/stack_user.c: fix typo in ocfs2_control_release()

It is supposed to zero pv_minor.

Reported-by: Himangi Saraogi <himangi774@gmail.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/ocfs2/stack_user.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/ocfs2/stack_user.c~fs-ocfs2-stack_userc-fix-typo-in-ocfs2_control_release fs/ocfs2/stack_user.c
--- a/fs/ocfs2/stack_user.c~fs-ocfs2-stack_userc-fix-typo-in-ocfs2_control_release
+++ a/fs/ocfs2/stack_user.c
@@ -591,7 +591,7 @@ static int ocfs2_control_release(struct
 		 */
 		ocfs2_control_this_node = -1;
 		running_proto.pv_major = 0;
-		running_proto.pv_major = 0;
+		running_proto.pv_minor = 0;
 	}
 
 out:
_


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

* [Ocfs2-devel] [PATCH] ocfs2: delete double assignment
@ 2014-08-21 21:58   ` Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2014-08-21 21:58 UTC (permalink / raw
  To: Himangi Saraogi
  Cc: Mark Fasheh, Joel Becker, ocfs2-devel, linux-kernel, julia.lawall

On Mon, 28 Jul 2014 20:56:32 +0530 Himangi Saraogi <himangi774@gmail.com> wrote:

> Delete successive assignments to the same location. The two assignments are
> simply identical.
> 
> A simplified version of Coccinelle semantic match that finds this problem is as
> follows:
> 
> // <smpl>
> @@
> expression i;
> @@
> 
> *i = ...;
>  i = ...;
> // </smpl>
> 
> Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
> ---
> Should the fist assignment be initializing the pv_minor field?

I'd say so, yes.


From: Andrew Morton <akpm@linux-foundation.org>
Subject: fs/ocfs2/stack_user.c: fix typo in ocfs2_control_release()

It is supposed to zero pv_minor.

Reported-by: Himangi Saraogi <himangi774@gmail.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/ocfs2/stack_user.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/ocfs2/stack_user.c~fs-ocfs2-stack_userc-fix-typo-in-ocfs2_control_release fs/ocfs2/stack_user.c
--- a/fs/ocfs2/stack_user.c~fs-ocfs2-stack_userc-fix-typo-in-ocfs2_control_release
+++ a/fs/ocfs2/stack_user.c
@@ -591,7 +591,7 @@ static int ocfs2_control_release(struct
 		 */
 		ocfs2_control_this_node = -1;
 		running_proto.pv_major = 0;
-		running_proto.pv_major = 0;
+		running_proto.pv_minor = 0;
 	}
 
 out:
_

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

end of thread, other threads:[~2014-08-21 21:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-28 15:26 [PATCH] ocfs2: delete double assignment Himangi Saraogi
2014-07-28 15:26 ` [Ocfs2-devel] " Himangi Saraogi
2014-08-21 21:58 ` Andrew Morton
2014-08-21 21:58   ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.