Skip to contentSkip to conversation

crypto: tcrypt: constify check alg list

PATCH In review Corentin Labbe 2 participants 2 messages Nov 8, 2019 – Nov 15, 2019 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: tcrypt: constify check alg list

this patchs constify the alg list because this list is never modified.

---
 crypto/tcrypt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
crypto/tcrypt.c +2 -2
index 83ad0b1fab30..f42f486e90e8 100644
@@ -65,7 +65,7 @@ static int mode;
 static u32 num_mb = 8;
 static char *tvmem[TVMEMSIZE];
 
-static char *check[] = {
+static const char *check[] = {
 	"des", "md5", "des3_ede", "rot13", "sha1", "sha224", "sha256", "sm3",
 	"blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes",
 	"cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
@@ -1634,7 +1634,7 @@ static void test_cipher_speed(const char *algo, int enc, unsigned int secs,
 
 static void test_available(void)
 {
-	char **name = check;
+	const char **name = check;
 
 	while (*name) {
 		printk("alg %s ", *name);
Signature · 1 line
2.23.0
maintainer
#1 lore raw
Quoted 6 lines · Corentin Labbe

this patchs constify the alg list because this list is never modified.

---
 crypto/tcrypt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt