]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[CRYPTO] Simplify one-member scatterlist expressions
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 19 Sep 2005 12:30:11 +0000 (22:30 +1000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 30 Oct 2005 00:19:43 +0000 (11:19 +1100)
This patch rewrites various occurences of &sg[0] where sg is an array
of length one to simply sg.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/tcrypt.c
drivers/net/wireless/airo.c
net/sunrpc/auth_gss/gss_krb5_crypto.c

index 577a3aff31139c0b757861125a63597e8ad3dc54..53f4ee804bdb6a52ebe4a594c2c3d1589954b31f 100644 (file)
@@ -415,12 +415,12 @@ out:
 static int test_cipher_jiffies(struct crypto_tfm *tfm, int enc, char *p,
                               int blen, int sec)
 {
-       struct scatterlist sg[8];
+       struct scatterlist sg[1];
        unsigned long start, end;
        int bcount;
        int ret;
 
-       sg_set_buf(&sg[0], p, blen);
+       sg_set_buf(sg, p, blen);
 
        for (start = jiffies, end = start + sec * HZ, bcount = 0;
             time_before(jiffies, end); bcount++) {
@@ -441,12 +441,12 @@ static int test_cipher_jiffies(struct crypto_tfm *tfm, int enc, char *p,
 static int test_cipher_cycles(struct crypto_tfm *tfm, int enc, char *p,
                              int blen)
 {
-       struct scatterlist sg[8];
+       struct scatterlist sg[1];
        unsigned long cycles = 0;
        int ret = 0;
        int i;
 
-       sg_set_buf(&sg[0], p, blen);
+       sg_set_buf(sg, p, blen);
 
        local_bh_disable();
        local_irq_disable();
index 1609ce11389d8905d5137f07e189d6a79cc5b7ff..750c0167539cb84fc5a6db303b220a70dc9a68f1 100644 (file)
@@ -1591,9 +1591,9 @@ static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct
                aes_counter[12] = (u8)(counter >> 24);
                counter++;
                memcpy (plain, aes_counter, 16);
-               sg_set_buf(&sg[0], plain, 16);
+               sg_set_buf(sg, plain, 16);
                crypto_cipher_encrypt(tfm, sg, sg, 16);
-               cipher = kmap(sg[0].page) + sg[0].offset;
+               cipher = kmap(sg->page) + sg->offset;
                for (j=0; (j<16) && (i< (sizeof(context->coeff)/sizeof(context->coeff[0]))); ) {
                        context->coeff[i++] = ntohl(*(u32 *)&cipher[j]);
                        j += 4;
index e65e1f9792753f5d568e0a7d1d9e41d893457c79..97c981fa6b8ee4a48118cf46801e1fef60388b23 100644 (file)
@@ -75,7 +75,7 @@ krb5_encrypt(
                memcpy(local_iv, iv, crypto_tfm_alg_ivsize(tfm));
 
        memcpy(out, in, length);
-       sg_set_buf(&sg[0], out, length);
+       sg_set_buf(sg, out, length);
 
        ret = crypto_cipher_encrypt_iv(tfm, sg, sg, length, local_iv);
 
@@ -115,7 +115,7 @@ krb5_decrypt(
                memcpy(local_iv,iv, crypto_tfm_alg_ivsize(tfm));
 
        memcpy(out, in, length);
-       sg_set_buf(&sg[0], out, length);
+       sg_set_buf(sg, out, length);
 
        ret = crypto_cipher_decrypt_iv(tfm, sg, sg, length, local_iv);