]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[CRYPTO]: Kill unnecessary strncpy from tcrypt
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 22 Jun 2005 20:26:36 +0000 (13:26 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Jun 2005 20:26:36 +0000 (13:26 -0700)
It seems that bad code tends to get copied (see test_cipher_speed).  So let's
kill this idiom before it spreads any further.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
crypto/tcrypt.c

index 5a95b4a14c2bdba0e01fb491688cd5e9be74db6d..85a88a71ff5318936b42ebf44294025648356d47 100644 (file)
@@ -266,16 +266,16 @@ static void test_cipher(char *algo, int mode, int enc,
        char *key;
        struct cipher_testvec *cipher_tv;
        struct scatterlist sg[8];
-       char e[11], m[4];
+       const char *e, *m;
 
        if (enc == ENCRYPT)
-               strncpy(e, "encryption", 11);
+               e = "encryption";
        else
-               strncpy(e, "decryption", 11);
+               e = "decryption";
        if (mode == MODE_ECB)
-               strncpy(m, "ECB", 4);
+               m = "ECB";
        else
-               strncpy(m, "CBC", 4);
+               m = "CBC";
 
        printk("\ntesting %s %s %s\n", algo, m, e);