Skip to contentSkip to conversation

staging: ccree: remove unused function argument

PATCH In review Arnd Bergmann 2 participants 3 messages May 11, 2017 – May 14, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: ccree: remove unused function argument

"gcc -Wunused" warns about one argument being assigned but not used:

drivers/staging/ccree/ssi_cipher.c: In function 'ssi_blkcipher_complete':
drivers/staging/ccree/ssi_cipher.c:747:41: error: parameter 'info' set but not used [-Werror=unused-but-set-parameter]

We can simply drop that argument here and in its callers.

Fixes 302ef8ebb4b2 ("staging: ccree: add skcipher support")
---
 drivers/staging/ccree/ssi_cipher.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/ccree/ssi_cipher.c +2 -4
index 664ed7e52cf2..d114cd07e729 100644
@@ -744,7 +744,6 @@ static int ssi_blkcipher_complete(struct device *dev,
                                   struct ssi_ablkcipher_ctx *ctx_p, 
                                   struct blkcipher_req_ctx *req_ctx,
                                   struct scatterlist *dst, struct scatterlist *src,
-                                  void *info, //req info
                                   unsigned int ivsize,
                                   void *areq,
                                   void __iomem *cc_base)
@@ -755,7 +754,6 @@ static int ssi_blkcipher_complete(struct device *dev,
 
 	START_CYCLE_COUNT();
 	ssi_buffer_mgr_unmap_blkcipher_request(dev, req_ctx, ivsize, src, dst);
-	info = req_ctx->backup_info;
 	END_CYCLE_COUNT(STAT_OP_TYPE_GENERIC, STAT_PHASE_4);
 
 
@@ -895,7 +893,7 @@ static int ssi_blkcipher_process(
 			END_CYCLE_COUNT(ssi_req.op_type, STAT_PHASE_3);            
 		} else {
 			END_CYCLE_COUNT(ssi_req.op_type, STAT_PHASE_3);
-			rc = ssi_blkcipher_complete(dev, ctx_p, req_ctx, dst, src, info, ivsize, NULL, ctx_p->drvdata->cc_base);
+			rc = ssi_blkcipher_complete(dev, ctx_p, req_ctx, dst, src, ivsize, NULL, ctx_p->drvdata->cc_base);
 		} 
 	}
 
@@ -916,7 +914,7 @@ static void ssi_ablkcipher_complete(struct device *dev, void *ssi_req, void __io
 
 	CHECK_AND_RETURN_VOID_UPON_FIPS_ERROR();
 
-	ssi_blkcipher_complete(dev, ctx_p, req_ctx, areq->dst, areq->src, areq->info, ivsize, areq, cc_base);
+	ssi_blkcipher_complete(dev, ctx_p, req_ctx, areq->dst, areq->src, ivsize, areq, cc_base);
 }
 
 
Signature · 1 line
2.9.0
#1 lore raw

Hi Arnd,

Quoted 9 lines · Arnd Bergmann

"gcc -Wunused" warns about one argument being assigned but not used:

drivers/staging/ccree/ssi_cipher.c: In function 'ssi_blkcipher_complete':
drivers/staging/ccree/ssi_cipher.c:747:41: error: parameter 'info' set but not used [-Werror=unused-but-set-parameter]

We can simply drop that argument here and in its callers.

Fixes 302ef8ebb4b2 ("staging: ccree: add skcipher support")

Thanks for spotting this. There used to be some code that used this parameter there, way back when.

The patch didn't apply after recent changes due to line moves so I re-based it and also took the opportunity
to trim the > 80 char lines. I hope that is OK.

Thanks!
Gilad

Signature · 6 lines
Gilad Ben-Yossef
Chief Coffee Drinker

"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
 -- Jean-Baptiste Queru
#2 lore raw

PATCH v2 1/1 staging: ccree: remove unused function argument

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

"gcc -Wunused" warns about one argument being assigned but not used:

drivers/staging/ccree/ssi_cipher.c: In function 'ssi_blkcipher_complete':
drivers/staging/ccree/ssi_cipher.c:747:41: error: parameter 'info' set but not used [-Werror=unused-but-set-parameter]

We can simply drop that argument here and in its callers.

Fixes 302ef8ebb4b2 ("staging: ccree: add skcipher support")
[ gby: rebased patch on latest revision and chopped >80 chars long lines ]
---
 drivers/staging/ccree/ssi_cipher.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/staging/ccree/ssi_cipher.c +5 -4
index ea0e863..d245a2b 100644
@@ -744,7 +744,6 @@ static int ssi_blkcipher_complete(struct device *dev,
                                   struct ssi_ablkcipher_ctx *ctx_p,
                                   struct blkcipher_req_ctx *req_ctx,
                                   struct scatterlist *dst, struct scatterlist *src,
-                                  void *info, //req info
                                   unsigned int ivsize,
                                   void *areq,
                                   void __iomem *cc_base)
@@ -755,7 +754,6 @@ static int ssi_blkcipher_complete(struct device *dev,
 
 	START_CYCLE_COUNT();
 	ssi_buffer_mgr_unmap_blkcipher_request(dev, req_ctx, ivsize, src, dst);
-	info = req_ctx->backup_info;
 	END_CYCLE_COUNT(STAT_OP_TYPE_GENERIC, STAT_PHASE_4);
 
 
@@ -895,7 +893,9 @@ static int ssi_blkcipher_process(
 			END_CYCLE_COUNT(ssi_req.op_type, STAT_PHASE_3);
 		} else {
 			END_CYCLE_COUNT(ssi_req.op_type, STAT_PHASE_3);
-			rc = ssi_blkcipher_complete(dev, ctx_p, req_ctx, dst, src, info, ivsize, NULL, ctx_p->drvdata->cc_base);
+			rc = ssi_blkcipher_complete(dev, ctx_p, req_ctx, dst,
+						    src, ivsize, NULL,
+						    ctx_p->drvdata->cc_base);
 		}
 	}
 
@@ -916,7 +916,8 @@ static void ssi_ablkcipher_complete(struct device *dev, void *ssi_req, void __io
 
 	CHECK_AND_RETURN_VOID_UPON_FIPS_ERROR();
 
-	ssi_blkcipher_complete(dev, ctx_p, req_ctx, areq->dst, areq->src, areq->info, ivsize, areq, cc_base);
+	ssi_blkcipher_complete(dev, ctx_p, req_ctx, areq->dst, areq->src,
+			       ivsize, areq, cc_base);
 }
 
 
Signature · 1 line
2.1.4