From: Eric Dumazet <dada1@cosmosbay.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: Linux Netdev List <netdev@vger.kernel.org>
Subject: [XFRM]: alg_key_len should be unsigned to avoid integer divides
Date: Sat, 12 Jan 2008 18:29:32 +0100 [thread overview]
Message-ID: <4788F8FC.3010001@cosmosbay.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 235 bytes --]
alg_key_len is currently defined as 'signed int'. This unfortunatly leads
to integer divides in several paths.
Converting it to unsigned is safe and saves 208 bytes of text on i386.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
[-- Attachment #2: xfrm_alg_key_len.patch --]
[-- Type: text/plain, Size: 333 bytes --]
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 1131eab..f8507ee 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -92,7 +92,7 @@ struct xfrm_replay_state
struct xfrm_algo {
char alg_name[64];
- int alg_key_len; /* in bits */
+ unsigned int alg_key_len; /* in bits */
char alg_key[0];
};
next reply other threads:[~2008-01-12 17:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-12 17:29 Eric Dumazet [this message]
2008-01-13 5:32 ` [XFRM]: alg_key_len should be unsigned to avoid integer divides David Miller
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=4788F8FC.3010001@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).