[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1460603338-4955-1-git-send-email-zengzhaoxiu@163.com>
Date: Thu, 14 Apr 2016 11:08:57 +0800
From: zengzhaoxiu@....com
To: linux-kernel@...r.kernel.org
Cc: Zhaoxiu Zeng <zhaoxiu.zeng@...il.com>,
"J. Bruce Fields" <bfields@...ldses.org>,
Jeff Layton <jlayton@...chiereds.net>,
Trond Myklebust <trond.myklebust@...marydata.com>,
Anna Schumaker <anna.schumaker@...app.com>,
"David S. Miller" <davem@...emloft.net>,
Herbert Xu <herbert@...dor.apana.org.au>,
linux-nfs@...r.kernel.org, netdev@...r.kernel.org
Subject: [PATCH V3 10/29] sunrpc: use parity8
From: Zhaoxiu Zeng <zhaoxiu.zeng@...il.com>
Signed-off-by: Zhaoxiu Zeng <zhaoxiu.zeng@...il.com>
---
net/sunrpc/auth_gss/gss_krb5_keys.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/net/sunrpc/auth_gss/gss_krb5_keys.c b/net/sunrpc/auth_gss/gss_krb5_keys.c
index 8701331..c41b389 100644
--- a/net/sunrpc/auth_gss/gss_krb5_keys.c
+++ b/net/sunrpc/auth_gss/gss_krb5_keys.c
@@ -243,16 +243,12 @@ err_return:
return ret;
}
-#define smask(step) ((1<<step)-1)
-#define pstep(x, step) (((x)&smask(step))^(((x)>>step)&smask(step)))
-#define parity_char(x) pstep(pstep(pstep((x), 4), 2), 1)
-
static void mit_des_fixup_key_parity(u8 key[8])
{
int i;
for (i = 0; i < 8; i++) {
key[i] &= 0xfe;
- key[i] |= 1^parity_char(key[i]);
+ key[i] |= !parity8(key[i]);
}
}
--
2.5.0
Powered by blists - more mailing lists