Re: [Ocfs2-devel] [PATCH] ocfs2: delete double assignment

From: Andrew Morton
Date: Thu Aug 21 2014 - 17:58:49 EST


On Mon, 28 Jul 2014 20:56:32 +0530 Himangi Saraogi <himangi774@xxxxxxxxx> 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@xxxxxxxxx>
> ---
> Should the fist assignment be initializing the pv_minor field?

I'd say so, yes.


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

It is supposed to zero pv_minor.

Reported-by: Himangi Saraogi <himangi774@xxxxxxxxx>
Cc: Mark Fasheh <mfasheh@xxxxxxxx>
Cc: Joel Becker <jlbec@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

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:
_

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/