Commit 9cc3b98d authored by YueHaibing's avatar YueHaibing Committed by J. Bruce Fields

sunrpc: remove redundant variables 'checksumlen','blocksize' and 'data'

Variables 'checksumlen','blocksize' and 'data' are being assigned,
but are never used, hence they are redundant and can be removed.

Fix the following warning:

  net/sunrpc/auth_gss/gss_krb5_wrap.c:443:7: warning: variable ‘blocksize’ set but not used [-Wunused-but-set-variable]
  net/sunrpc/auth_gss/gss_krb5_crypto.c:376:15: warning: variable ‘checksumlen’ set but not used [-Wunused-but-set-variable]
  net/sunrpc/xprtrdma/svc_rdma.c:97:9: warning: variable ‘data’ set but not used [-Wunused-but-set-variable]
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Reviewed-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 64bed6cb
...@@ -373,7 +373,6 @@ make_checksum_v2(struct krb5_ctx *kctx, char *header, int hdrlen, ...@@ -373,7 +373,6 @@ make_checksum_v2(struct krb5_ctx *kctx, char *header, int hdrlen,
struct scatterlist sg[1]; struct scatterlist sg[1];
int err = -1; int err = -1;
u8 *checksumdata; u8 *checksumdata;
unsigned int checksumlen;
if (kctx->gk5e->keyed_cksum == 0) { if (kctx->gk5e->keyed_cksum == 0) {
dprintk("%s: expected keyed hash for %s\n", dprintk("%s: expected keyed hash for %s\n",
...@@ -393,7 +392,6 @@ make_checksum_v2(struct krb5_ctx *kctx, char *header, int hdrlen, ...@@ -393,7 +392,6 @@ make_checksum_v2(struct krb5_ctx *kctx, char *header, int hdrlen,
tfm = crypto_alloc_ahash(kctx->gk5e->cksum_name, 0, CRYPTO_ALG_ASYNC); tfm = crypto_alloc_ahash(kctx->gk5e->cksum_name, 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(tfm)) if (IS_ERR(tfm))
goto out_free_cksum; goto out_free_cksum;
checksumlen = crypto_ahash_digestsize(tfm);
req = ahash_request_alloc(tfm, GFP_NOFS); req = ahash_request_alloc(tfm, GFP_NOFS);
if (!req) if (!req)
......
...@@ -440,7 +440,6 @@ static u32 ...@@ -440,7 +440,6 @@ static u32
gss_wrap_kerberos_v2(struct krb5_ctx *kctx, u32 offset, gss_wrap_kerberos_v2(struct krb5_ctx *kctx, u32 offset,
struct xdr_buf *buf, struct page **pages) struct xdr_buf *buf, struct page **pages)
{ {
int blocksize;
u8 *ptr, *plainhdr; u8 *ptr, *plainhdr;
s32 now; s32 now;
u8 flags = 0x00; u8 flags = 0x00;
...@@ -473,7 +472,6 @@ gss_wrap_kerberos_v2(struct krb5_ctx *kctx, u32 offset, ...@@ -473,7 +472,6 @@ gss_wrap_kerberos_v2(struct krb5_ctx *kctx, u32 offset,
*ptr++ = 0xff; *ptr++ = 0xff;
be16ptr = (__be16 *)ptr; be16ptr = (__be16 *)ptr;
blocksize = crypto_skcipher_blocksize(kctx->acceptor_enc);
*be16ptr++ = 0; *be16ptr++ = 0;
/* "inner" token header always uses 0 for RRC */ /* "inner" token header always uses 0 for RRC */
*be16ptr++ = 0; *be16ptr++ = 0;
......
...@@ -94,7 +94,6 @@ static int read_reset_stat(struct ctl_table *table, int write, ...@@ -94,7 +94,6 @@ static int read_reset_stat(struct ctl_table *table, int write,
atomic_set(stat, 0); atomic_set(stat, 0);
else { else {
char str_buf[32]; char str_buf[32];
char *data;
int len = snprintf(str_buf, 32, "%d\n", atomic_read(stat)); int len = snprintf(str_buf, 32, "%d\n", atomic_read(stat));
if (len >= 32) if (len >= 32)
return -EFAULT; return -EFAULT;
...@@ -103,7 +102,6 @@ static int read_reset_stat(struct ctl_table *table, int write, ...@@ -103,7 +102,6 @@ static int read_reset_stat(struct ctl_table *table, int write,
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
data = &str_buf[*ppos];
len -= *ppos; len -= *ppos;
if (len > *lenp) if (len > *lenp)
len = *lenp; len = *lenp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment