netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [XFRM]: alg_key_len should be unsigned to avoid integer divides
@ 2008-01-12 17:29 Eric Dumazet
  2008-01-13  5:32 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2008-01-12 17:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: Linux Netdev List

[-- 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];
 };
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-01-13  5:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-12 17:29 [XFRM]: alg_key_len should be unsigned to avoid integer divides Eric Dumazet
2008-01-13  5:32 ` David Miller

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).