From: "Diego 'Flameeyes' Pettenò" <flameeyes@gmail.com>
To: linux-wireless@vger.kernel.org
Subject: [crda PATCH 2/3] Mark constant the generated key tables for libgcrypt.
Date: Mon, 01 Dec 2008 12:11:23 +0100 [thread overview]
Message-ID: <20081201111123.20833.93890.stgit@localhost> (raw)
In-Reply-To: <20081201111021.20833.42515.stgit@localhost>
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))
next prev parent reply other threads:[~2008-12-01 11:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-01 11:11 [crda PATCH 0/3] Code fixups and optimisation Diego 'Flameeyes' Pettenò
2008-12-01 11:11 ` [crda PATCH 1/3] Mark functions static when not used outside their translation unit Diego 'Flameeyes' Pettenò
2008-12-01 11:11 ` Diego 'Flameeyes' Pettenò [this message]
2008-12-01 11:11 ` [crda PATCH 3/3] Avoid implicit declaration of memset() with OpenSSL Diego 'Flameeyes' Pettenò
2008-12-01 22:35 ` [crda PATCH 0/3] Code fixups and optimisation Luis R. Rodriguez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081201111123.20833.93890.stgit@localhost \
--to=flameeyes@gmail.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.