These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / staging / lustre / lustre / libcfs / linux / linux-crypto.c
index aa3fffe..079d50e 100644 (file)
@@ -36,8 +36,6 @@
  */
 static int cfs_crypto_hash_speeds[CFS_HASH_ALG_MAX];
 
-
-
 static int cfs_crypto_hash_alloc(unsigned char alg_id,
                                 const struct cfs_crypto_hash_type **type,
                                 struct hash_desc *desc, unsigned char *key,
@@ -71,13 +69,12 @@ static int cfs_crypto_hash_alloc(unsigned char alg_id,
         * Skip this function for digest, because we use shash logic at
         * cfs_crypto_hash_alloc.
         */
-       if (key != NULL) {
+       if (key != NULL)
                err = crypto_hash_setkey(desc->tfm, key, key_len);
-       } else if ((*type)->cht_key != 0) {
+       else if ((*type)->cht_key != 0)
                err = crypto_hash_setkey(desc->tfm,
                                         (unsigned char *)&((*type)->cht_key),
                                         (*type)->cht_size);
-       }
 
        if (err != 0) {
                crypto_free_hash(desc->tfm);
@@ -114,7 +111,7 @@ int cfs_crypto_hash_digest(unsigned char alg_id,
                crypto_free_hash(hdesc.tfm);
                return -ENOSPC;
        }
-       sg_init_one(&sl, (void *)buf, buf_len);
+       sg_init_one(&sl, buf, buf_len);
 
        hdesc.flags = 0;
        err = crypto_hash_digest(&hdesc, &sl, sl.length, hash);
@@ -165,7 +162,7 @@ int cfs_crypto_hash_update(struct cfs_crypto_hash_desc *hdesc,
 {
        struct scatterlist sl;
 
-       sg_init_one(&sl, (void *)buf, buf_len);
+       sg_init_one(&sl, buf, buf_len);
 
        return crypto_hash_update((struct hash_desc *)hdesc, &sl, sl.length);
 }
@@ -225,6 +222,7 @@ static void cfs_crypto_performance_test(unsigned char alg_id,
                       cfs_crypto_hash_name(alg_id), err);
        } else {
                unsigned long   tmp;
+
                tmp = ((bcount * buf_len / jiffies_to_msecs(end - start)) *
                       1000) / (1024 * 1024);
                cfs_crypto_hash_speeds[alg_id] = (int)tmp;
@@ -282,6 +280,7 @@ int cfs_crypto_register(void)
        cfs_crypto_test_hashes();
        return 0;
 }
+
 void cfs_crypto_unregister(void)
 {
        if (adler32 == 0)