linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] crypto: nx842 - remove set but not used variables 'dpadding' and 'max_sync_size'
@ 2019-03-30  5:54 Yue Haibing
  2019-03-30  9:58 ` Mukesh Ojha
  2019-04-08  6:41 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Yue Haibing @ 2019-03-30  5:54 UTC (permalink / raw)
  To: haren, herbert, davem, benh, paulus, mpe
  Cc: linux-kernel, linux-crypto, linuxppc-dev, YueHaibing

From: YueHaibing <yuehaibing@huawei.com>

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/crypto/nx/nx-842.c: In function 'decompress':
drivers/crypto/nx/nx-842.c:356:25: warning: variable 'dpadding' set but not used [-Wunused-but-set-variable]
drivers/crypto/nx/nx-842-pseries.c: In function 'nx842_pseries_compress':
drivers/crypto/nx/nx-842-pseries.c:299:15: warning: variable 'max_sync_size' set but not used [-Wunused-but-set-variable]
drivers/crypto/nx/nx-842-pseries.c: In function 'nx842_pseries_decompress':
drivers/crypto/nx/nx-842-pseries.c:430:15: warning: variable 'max_sync_size' set but not used [-Wunused-but-set-variable]

They are not used any more and can be removed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/crypto/nx/nx-842-pseries.c | 6 ++----
 drivers/crypto/nx/nx-842.c         | 3 +--
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/nx/nx-842-pseries.c b/drivers/crypto/nx/nx-842-pseries.c
index 6686997..5793284 100644
--- a/drivers/crypto/nx/nx-842-pseries.c
+++ b/drivers/crypto/nx/nx-842-pseries.c
@@ -296,7 +296,7 @@ static int nx842_pseries_compress(const unsigned char *in, unsigned int inlen,
 	struct nx842_workmem *workmem;
 	struct nx842_scatterlist slin, slout;
 	struct nx_csbcpb *csbcpb;
-	int ret = 0, max_sync_size;
+	int ret = 0;
 	unsigned long inbuf, outbuf;
 	struct vio_pfo_op op = {
 		.done = NULL,
@@ -319,7 +319,6 @@ static int nx842_pseries_compress(const unsigned char *in, unsigned int inlen,
 		rcu_read_unlock();
 		return -ENODEV;
 	}
-	max_sync_size = local_devdata->max_sync_size;
 	dev = local_devdata->dev;
 
 	/* Init scatterlist */
@@ -427,7 +426,7 @@ static int nx842_pseries_decompress(const unsigned char *in, unsigned int inlen,
 	struct nx842_workmem *workmem;
 	struct nx842_scatterlist slin, slout;
 	struct nx_csbcpb *csbcpb;
-	int ret = 0, max_sync_size;
+	int ret = 0;
 	unsigned long inbuf, outbuf;
 	struct vio_pfo_op op = {
 		.done = NULL,
@@ -451,7 +450,6 @@ static int nx842_pseries_decompress(const unsigned char *in, unsigned int inlen,
 		rcu_read_unlock();
 		return -ENODEV;
 	}
-	max_sync_size = local_devdata->max_sync_size;
 	dev = local_devdata->dev;
 
 	workmem = PTR_ALIGN(wmem, WORKMEM_ALIGN);
diff --git a/drivers/crypto/nx/nx-842.c b/drivers/crypto/nx/nx-842.c
index d94e25d..f06565d 100644
--- a/drivers/crypto/nx/nx-842.c
+++ b/drivers/crypto/nx/nx-842.c
@@ -353,7 +353,7 @@ static int decompress(struct nx842_crypto_ctx *ctx,
 	unsigned int adj_slen = slen;
 	u8 *src = p->in, *dst = p->out;
 	u16 padding = be16_to_cpu(g->padding);
-	int ret, spadding = 0, dpadding = 0;
+	int ret, spadding = 0;
 	ktime_t timeout;
 
 	if (!slen || !required_len)
@@ -413,7 +413,6 @@ static int decompress(struct nx842_crypto_ctx *ctx,
 		spadding = 0;
 		dst = p->out;
 		dlen = p->oremain;
-		dpadding = 0;
 		if (dlen < required_len) { /* have ignore bytes */
 			dst = ctx->dbounce;
 			dlen = BOUNCE_BUFFER_SIZE;
-- 
2.7.0



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

* Re: [PATCH -next] crypto: nx842 - remove set but not used variables 'dpadding' and 'max_sync_size'
  2019-03-30  5:54 [PATCH -next] crypto: nx842 - remove set but not used variables 'dpadding' and 'max_sync_size' Yue Haibing
@ 2019-03-30  9:58 ` Mukesh Ojha
  2019-04-08  6:41 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Mukesh Ojha @ 2019-03-30  9:58 UTC (permalink / raw)
  To: Yue Haibing, haren, herbert, davem, benh, paulus, mpe
  Cc: linux-kernel, linux-crypto, linuxppc-dev


On 3/30/2019 11:24 AM, Yue Haibing wrote:
> From: YueHaibing <yuehaibing@huawei.com>
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/crypto/nx/nx-842.c: In function 'decompress':
> drivers/crypto/nx/nx-842.c:356:25: warning: variable 'dpadding' set but not used [-Wunused-but-set-variable]
> drivers/crypto/nx/nx-842-pseries.c: In function 'nx842_pseries_compress':
> drivers/crypto/nx/nx-842-pseries.c:299:15: warning: variable 'max_sync_size' set but not used [-Wunused-but-set-variable]
> drivers/crypto/nx/nx-842-pseries.c: In function 'nx842_pseries_decompress':
> drivers/crypto/nx/nx-842-pseries.c:430:15: warning: variable 'max_sync_size' set but not used [-Wunused-but-set-variable]
>
> They are not used any more and can be removed.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

Cheers,
-Mukesh
> ---
>   drivers/crypto/nx/nx-842-pseries.c | 6 ++----
>   drivers/crypto/nx/nx-842.c         | 3 +--
>   2 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/crypto/nx/nx-842-pseries.c b/drivers/crypto/nx/nx-842-pseries.c
> index 6686997..5793284 100644
> --- a/drivers/crypto/nx/nx-842-pseries.c
> +++ b/drivers/crypto/nx/nx-842-pseries.c
> @@ -296,7 +296,7 @@ static int nx842_pseries_compress(const unsigned char *in, unsigned int inlen,
>   	struct nx842_workmem *workmem;
>   	struct nx842_scatterlist slin, slout;
>   	struct nx_csbcpb *csbcpb;
> -	int ret = 0, max_sync_size;
> +	int ret = 0;
>   	unsigned long inbuf, outbuf;
>   	struct vio_pfo_op op = {
>   		.done = NULL,
> @@ -319,7 +319,6 @@ static int nx842_pseries_compress(const unsigned char *in, unsigned int inlen,
>   		rcu_read_unlock();
>   		return -ENODEV;
>   	}
> -	max_sync_size = local_devdata->max_sync_size;
>   	dev = local_devdata->dev;
>   
>   	/* Init scatterlist */
> @@ -427,7 +426,7 @@ static int nx842_pseries_decompress(const unsigned char *in, unsigned int inlen,
>   	struct nx842_workmem *workmem;
>   	struct nx842_scatterlist slin, slout;
>   	struct nx_csbcpb *csbcpb;
> -	int ret = 0, max_sync_size;
> +	int ret = 0;
>   	unsigned long inbuf, outbuf;
>   	struct vio_pfo_op op = {
>   		.done = NULL,
> @@ -451,7 +450,6 @@ static int nx842_pseries_decompress(const unsigned char *in, unsigned int inlen,
>   		rcu_read_unlock();
>   		return -ENODEV;
>   	}
> -	max_sync_size = local_devdata->max_sync_size;
>   	dev = local_devdata->dev;
>   
>   	workmem = PTR_ALIGN(wmem, WORKMEM_ALIGN);
> diff --git a/drivers/crypto/nx/nx-842.c b/drivers/crypto/nx/nx-842.c
> index d94e25d..f06565d 100644
> --- a/drivers/crypto/nx/nx-842.c
> +++ b/drivers/crypto/nx/nx-842.c
> @@ -353,7 +353,7 @@ static int decompress(struct nx842_crypto_ctx *ctx,
>   	unsigned int adj_slen = slen;
>   	u8 *src = p->in, *dst = p->out;
>   	u16 padding = be16_to_cpu(g->padding);
> -	int ret, spadding = 0, dpadding = 0;
> +	int ret, spadding = 0;
>   	ktime_t timeout;
>   
>   	if (!slen || !required_len)
> @@ -413,7 +413,6 @@ static int decompress(struct nx842_crypto_ctx *ctx,
>   		spadding = 0;
>   		dst = p->out;
>   		dlen = p->oremain;
> -		dpadding = 0;
>   		if (dlen < required_len) { /* have ignore bytes */
>   			dst = ctx->dbounce;
>   			dlen = BOUNCE_BUFFER_SIZE;

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

* Re: [PATCH -next] crypto: nx842 - remove set but not used variables 'dpadding' and 'max_sync_size'
  2019-03-30  5:54 [PATCH -next] crypto: nx842 - remove set but not used variables 'dpadding' and 'max_sync_size' Yue Haibing
  2019-03-30  9:58 ` Mukesh Ojha
@ 2019-04-08  6:41 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2019-04-08  6:41 UTC (permalink / raw)
  To: Yue Haibing
  Cc: haren, davem, benh, paulus, mpe, linux-kernel, linux-crypto,
	linuxppc-dev

On Sat, Mar 30, 2019 at 01:54:29PM +0800, Yue Haibing wrote:
> From: YueHaibing <yuehaibing@huawei.com>
> 
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/crypto/nx/nx-842.c: In function 'decompress':
> drivers/crypto/nx/nx-842.c:356:25: warning: variable 'dpadding' set but not used [-Wunused-but-set-variable]
> drivers/crypto/nx/nx-842-pseries.c: In function 'nx842_pseries_compress':
> drivers/crypto/nx/nx-842-pseries.c:299:15: warning: variable 'max_sync_size' set but not used [-Wunused-but-set-variable]
> drivers/crypto/nx/nx-842-pseries.c: In function 'nx842_pseries_decompress':
> drivers/crypto/nx/nx-842-pseries.c:430:15: warning: variable 'max_sync_size' set but not used [-Wunused-but-set-variable]
> 
> They are not used any more and can be removed.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/crypto/nx/nx-842-pseries.c | 6 ++----
>  drivers/crypto/nx/nx-842.c         | 3 +--
>  2 files changed, 3 insertions(+), 6 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

end of thread, other threads:[~2019-04-08  6:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-30  5:54 [PATCH -next] crypto: nx842 - remove set but not used variables 'dpadding' and 'max_sync_size' Yue Haibing
2019-03-30  9:58 ` Mukesh Ojha
2019-04-08  6:41 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).