From: Himangi Saraogi <himangi774@gmail.com>
To: David Howells <dhowells@redhat.com>,
linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: julia.lawall@lip6.fr
Subject: [PATCH] afs: delete double assignment
Date: Mon, 28 Jul 2014 20:54:58 +0530 [thread overview]
Message-ID: <20140728152457.GA2901@himangi-Dell> (raw)
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 second assignment is each case be a |= ?
fs/afs/main.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/fs/afs/main.c b/fs/afs/main.c
index 42dd2e4..a2f5a16 100644
--- a/fs/afs/main.c
+++ b/fs/afs/main.c
@@ -54,13 +54,10 @@ static int __init afs_get_client_UUID(void)
uuidtime += AFS_UUID_TO_UNIX_TIME;
afs_uuid.time_low = uuidtime;
afs_uuid.time_mid = uuidtime >> 32;
- afs_uuid.time_hi_and_version = (uuidtime >> 48) & AFS_UUID_TIMEHI_MASK;
afs_uuid.time_hi_and_version = AFS_UUID_VERSION_TIME;
get_random_bytes(&clockseq, 2);
afs_uuid.clock_seq_low = clockseq;
- afs_uuid.clock_seq_hi_and_reserved =
- (clockseq >> 8) & AFS_UUID_CLOCKHI_MASK;
afs_uuid.clock_seq_hi_and_reserved = AFS_UUID_VARIANT_STD;
_debug("AFS UUID: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
--
1.9.1
next reply other threads:[~2014-07-28 15:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-28 15:24 Himangi Saraogi [this message]
2014-07-28 15:29 ` David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140728152457.GA2901@himangi-Dell \
--to=himangi774@gmail.com \
--cc=dhowells@redhat.com \
--cc=julia.lawall@lip6.fr \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome