lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1519768888-19866-4-git-send-email-hernan@vanguardiasur.com.ar>
Date:   Tue, 27 Feb 2018 19:01:28 -0300
From:   Hernán Gonzalez <hernan@...guardiasur.com.ar>
To:     herbert@...dor.apana.org.au, davem@...emloft.net,
        hernan@...guardiasur.com.ar, steven.lin1@...adcom.com,
        arvind.yadav.cs@...il.com, colin.king@...onical.com,
        raveendra.padasalagi@...adcom.com, ray.jui@...adcom.com,
        scott.branden@...adcom.com, linux-crypto@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH 4/4] crypto: bcm: Constify variables in spu2.c

Note: This is compile only tested.
Variables constified:
*spu2_cipher_type_names
*spu2_hash_mode_names
*spu2_cipher_mode_names
*spu2_hash_type_names

Constifying and declaring as static saves 160 bytes.

add/remove: 0/4 grow/shrink: 0/0 up/down: 0/-160 (-160)
Function                                     old     new   delta
spu2_cipher_type_names                        24       -     -24
spu2_hash_mode_names                          32       -     -32
spu2_cipher_mode_names                        32       -     -32
spu2_hash_type_names                          72       -     -72
Total: Before=9185236, After=9185076, chg -0.00%

Signed-off-by: Hernán Gonzalez <hernan@...guardiasur.com.ar>
---
 drivers/crypto/bcm/spu2.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/crypto/bcm/spu2.c b/drivers/crypto/bcm/spu2.c
index bf7ac62..fcf3885 100644
--- a/drivers/crypto/bcm/spu2.c
+++ b/drivers/crypto/bcm/spu2.c
@@ -49,22 +49,22 @@ enum spu2_proto_sel {
 	SPU2_DTLS_AEAD = 10
 };
 
-char *spu2_cipher_type_names[] = { "None", "AES128", "AES192", "AES256",
-	"DES", "3DES"
+static char * const spu2_cipher_type_names[] = { "None", "AES128", "AES192",
+	"AES256", "DES", "3DES"
 };
 
-char *spu2_cipher_mode_names[] = { "ECB", "CBC", "CTR", "CFB", "OFB", "XTS",
-	"CCM", "GCM"
+static char * const spu2_cipher_mode_names[] = { "ECB", "CBC", "CTR", "CFB",
+	"OFB", "XTS", "CCM", "GCM"
 };
 
-char *spu2_hash_type_names[] = { "None", "AES128", "AES192", "AES256",
-	"Reserved", "Reserved", "MD5", "SHA1", "SHA224", "SHA256", "SHA384",
-	"SHA512", "SHA512/224", "SHA512/256", "SHA3-224", "SHA3-256",
+static char * const spu2_hash_type_names[] = { "None", "AES128", "AES192",
+	"AES256", "Reserved", "Reserved", "MD5", "SHA1", "SHA224", "SHA256",
+	"SHA384", "SHA512", "SHA512/224", "SHA512/256", "SHA3-224", "SHA3-256",
 	"SHA3-384", "SHA3-512"
 };
 
-char *spu2_hash_mode_names[] = { "CMAC", "CBC-MAC", "XCBC-MAC", "HMAC",
-	"Rabin", "CCM", "GCM", "Reserved"
+static char * const spu2_hash_mode_names[] = { "CMAC", "CBC-MAC", "XCBC-MAC",
+	"HMAC", "Rabin", "CCM", "GCM", "Reserved"
 };
 
 static char *spu2_ciph_type_name(enum spu2_cipher_type cipher_type)
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ