aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorDmitry Kasatkin <dmitry.kasatkin@nokia.com>2010-11-19 09:04:28 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2010-11-27 03:37:19 -0500
commita55b290b0e41e02d1969589c5d77d966ac2b7ec8 (patch)
treefcbff88a3f115e3bf4055d33388c72774f5e9982 /drivers/crypto
parent3c8d758ab528317ecd6d91f8651170ffd2331899 (diff)
crypto: omap-sham - FLAGS_FIRST is redundant and removed
bufcnt is 0 if it was no update requests before, which is exact meaning of FLAGS_FIRST. Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@nokia.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/omap-sham.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index c8d30eb4794a..d88d7ebfffa7 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -72,7 +72,6 @@
72 72
73#define DEFAULT_TIMEOUT_INTERVAL HZ 73#define DEFAULT_TIMEOUT_INTERVAL HZ
74 74
75#define FLAGS_FIRST 0x0001
76#define FLAGS_FINUP 0x0002 75#define FLAGS_FINUP 0x0002
77#define FLAGS_FINAL 0x0004 76#define FLAGS_FINAL 0x0004
78#define FLAGS_FAST 0x0008 77#define FLAGS_FAST 0x0008
@@ -513,8 +512,6 @@ static int omap_sham_init(struct ahash_request *req)
513 512
514 ctx->flags = 0; 513 ctx->flags = 0;
515 514
516 ctx->flags |= FLAGS_FIRST;
517
518 dev_dbg(dd->dev, "init: digest size: %d\n", 515 dev_dbg(dd->dev, "init: digest size: %d\n",
519 crypto_ahash_digestsize(tfm)); 516 crypto_ahash_digestsize(tfm));
520 517
@@ -739,12 +736,9 @@ static int omap_sham_update(struct ahash_request *req)
739 /* may be can use faster functions */ 736 /* may be can use faster functions */
740 int aligned = IS_ALIGNED((u32)ctx->sg->offset, 737 int aligned = IS_ALIGNED((u32)ctx->sg->offset,
741 sizeof(u32)); 738 sizeof(u32));
742 739 if (aligned)
743 if (aligned && (ctx->flags & FLAGS_FIRST))
744 /* digest: first and final */ 740 /* digest: first and final */
745 ctx->flags |= FLAGS_FAST; 741 ctx->flags |= FLAGS_FAST;
746
747 ctx->flags &= ~FLAGS_FIRST;
748 } 742 }
749 } else if (ctx->bufcnt + ctx->total <= ctx->buflen) { 743 } else if (ctx->bufcnt + ctx->total <= ctx->buflen) {
750 /* if not finaup -> not fast */ 744 /* if not finaup -> not fast */