Search Linux Wireless

[crda PATCH 2/3] Mark constant the generated key tables for libgcrypt.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since they are never modified, mark the key tables constant so they
are emitted in .rodata.

Note that even though they are probably also never modified, the
OpenSSL tables generate warnings when they are marked constant, as
such they are untouched.
---

 utils/key2pub.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/utils/key2pub.py b/utils/key2pub.py
index 8cd9596..bc1d33d 100755
--- a/utils/key2pub.py
+++ b/utils/key2pub.py
@@ -50,7 +50,7 @@ static struct pubkey keys[] = {
 def print_gcrypt(name, val):
     while val[0] == '\0':
         val = val[1:]
-    sys.stdout.write('static __u8 %s[%d] = {\n' % (name, len(val)))
+    sys.stdout.write('static const __u8 %s[%d] = {\n' % (name, len(val)))
     idx = 0
     for v in val:
         if not idx:
@@ -67,7 +67,7 @@ def print_gcrypt(name, val):
 def print_gcrypt_keys(n):
     sys.stdout.write(r'''
 struct key_params {
-	__u8 *e, *n;
+	const __u8 *e, *n;
 	__u32 len_e, len_n; 
 };
 
@@ -76,7 +76,7 @@ struct key_params {
 	.n = _n, .len_n = sizeof(_n),	\
 }
 
-static struct key_params keys[] = {
+static const struct key_params keys[] = {
 ''')
     for n in xrange(n + 1):
         sys.stdout.write('	KEYS(e_%d, n_%d),\n' % (n, n))

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux