aead_request_complete(areq, err);
 }
 
-static int xcbc_setkey(struct cc_hw_desc *desc, struct cc_aead_ctx *ctx)
+static unsigned int xcbc_setkey(struct cc_hw_desc *desc,
+                               struct cc_aead_ctx *ctx)
 {
        /* Load the AES key */
        hw_desc_init(&desc[0]);
        return 4;
 }
 
-static int hmac_setkey(struct cc_hw_desc *desc, struct cc_aead_ctx *ctx)
+static unsigned int hmac_setkey(struct cc_hw_desc *desc,
+                               struct cc_aead_ctx *ctx)
 {
        unsigned int hmac_pad_const[2] = { HMAC_IPAD_CONST, HMAC_OPAD_CONST };
        unsigned int digest_ofs = 0;
                        CC_SHA1_DIGEST_SIZE : CC_SHA256_DIGEST_SIZE;
        struct cc_hmac_s *hmac = &ctx->auth_state.hmac;
 
-       int idx = 0;
+       unsigned int idx = 0;
        int i;
 
        /* calc derived HMAC key */
        struct cc_crypto_req cc_req = {};
        struct crypto_authenc_key_param *param;
        struct cc_hw_desc desc[MAX_AEAD_SETKEY_SEQ];
-       int seq_len = 0, rc = -EINVAL;
+       unsigned int seq_len = 0;
+       int rc = -EINVAL;
        struct device *dev = drvdata_to_dev(ctx->drvdata);
 
        dev_dbg(dev, "Setting key in context @%p for %s. key=%p keylen=%u\n",
                        enum drv_crypto_direction direct)
 {
        int rc = 0;
-       int seq_len = 0;
+       unsigned int seq_len = 0;
        struct cc_hw_desc desc[MAX_AEAD_PROCESS_SEQ];
        struct crypto_aead *tfm = crypto_aead_reqtfm(req);
        struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm);
 
        struct device *dev = drvdata_to_dev(drvdata);
        enum drv_crypto_direction direct = areq_ctx->gen_ctx.op_type;
        unsigned int authsize = areq_ctx->req_authsize;
-       int src_last_bytes = 0, dst_last_bytes = 0;
+       u32 src_last_bytes = 0, dst_last_bytes = 0;
        int rc = 0;
        u32 src_mapped_nents = 0, dst_mapped_nents = 0;
        u32 offset = 0;
 
        struct device *dev = drvdata_to_dev(ctx_p->drvdata);
        struct cc_hw_desc desc[MAX_ABLKCIPHER_SEQ_LEN];
        struct cc_crypto_req cc_req = {};
-       int rc, seq_len = 0, cts_restore_flag = 0;
+       int rc, cts_restore_flag = 0;
+       unsigned int seq_len = 0;
        gfp_t flags = cc_gfp_flags(&req->base);
 
        dev_dbg(dev, "%s req=%p info=%p nbytes=%d\n",
 
        struct cc_hw_desc desc[CC_MAX_HASH_SEQ_LEN];
        cc_sram_addr_t larval_digest_addr =
                cc_larval_digest_addr(ctx->drvdata, ctx->hash_mode);
-       int idx = 0;
+       unsigned int idx = 0;
        int rc = 0;
        gfp_t flags = cc_gfp_flags(&req->base);
 
 }
 
 static int cc_restore_hash(struct cc_hw_desc *desc, struct cc_hash_ctx *ctx,
-                          struct ahash_req_ctx *state, int idx)
+                          struct ahash_req_ctx *state, unsigned int idx)
 {
        /* Restore hash digest */
        hw_desc_init(&desc[idx]);
        bool is_hmac = ctx->is_hmac;
        struct cc_crypto_req cc_req = {};
        struct cc_hw_desc desc[CC_MAX_HASH_SEQ_LEN];
-       int idx = 0;
+       unsigned int idx = 0;
        int rc;
        gfp_t flags = cc_gfp_flags(&req->base);
 
        bool is_hmac = ctx->is_hmac;
        struct cc_crypto_req cc_req = {};
        struct cc_hw_desc desc[CC_MAX_HASH_SEQ_LEN];
-       int idx = 0;
+       unsigned int idx = 0;
        int rc;
        gfp_t flags = cc_gfp_flags(&req->base);
 
        struct cc_crypto_req cc_req = {};
        struct cc_hash_ctx *ctx = crypto_ahash_ctx(ahash);
        struct device *dev = drvdata_to_dev(ctx->drvdata);
-       int idx = 0, rc = 0;
+       unsigned int idx = 0;
+       int rc = 0;
        struct cc_hw_desc desc[CC_MAX_HASH_SEQ_LEN];
 
        dev_dbg(dev, "===== setkey (%d) ====\n", keylen);
        struct device *dev = drvdata_to_dev(ctx->drvdata);
        struct cc_crypto_req cc_req = {};
        struct cc_hw_desc desc[CC_MAX_HASH_SEQ_LEN];
-       int idx = 0;
+       unsigned int idx = 0;
        int rc = 0;
        u32 key_size, key_len;
        u32 digestsize = crypto_ahash_digestsize(tfm);
        struct device *dev = drvdata_to_dev(ctx->drvdata);
        struct cc_crypto_req cc_req = {};
        struct cc_hw_desc desc[CC_MAX_HASH_SEQ_LEN];
-       int idx = 0;
+       unsigned int idx = 0;
        int rc = 0;
        u32 key_len = 0;
        u32 digestsize = crypto_ahash_digestsize(tfm);
        struct cc_crypto_req cc_req = {};
        struct cc_hw_desc desc[CC_MAX_HASH_SEQ_LEN];
        u32 key_len;
-       int idx = 0;
+       unsigned int idx = 0;
        int rc;
        gfp_t flags = cc_gfp_flags(&req->base);