: alg_key_len & alg_icv_len should be unsigned
Subsystems (2)
In commit ba749ae98d5aa9d2ce9a7facde0deed454f92230 ([XFRM]: alg_key_len should be unsigned to avoid integer divides <http://git2.kernel.org/?p=linux/kernel/git/davem/net-2.6.git;a=commitdiff;h=ba749ae98d5aa9d2ce9a7facde0deed454f92230>) alg_key_len field of struct xfrm_algo was converted to unsigned int to avoid integer divides.
Then Herbert in commit 1a6509d991225ad210de54c63314fd9542922095 ([IPSEC]: Add support for combined mode algorithms) added a new structure xfrm_algo_aead, that resurrected a signed int for alg_key_len and re-introduce integer divides.
This patch avoids these divides and saves 64 bytes of text on i386.
include/linux/xfrm.h +4 -4
@@ -97,10 +97,10 @@ struct xfrm_algo { };struct xfrm_algo_aead { -char alg_name[64 ]; -int alg_key_len;/* in bits */ -int alg_icv_len;/* in bits */ -char alg_key[0 ]; +char alg_name[64 ]; +unsigned int alg_key_len;/* in bits */ +unsigned int alg_icv_len;/* in bits */ +char alg_key[0 ]; };struct xfrm_stats {
Herbert Xu
Acked-byQuoted 6 lines · Eric Dumazet
In commit
ba749ae98d5aa9d2ce9a7facde0deed454f92230([XFRM]:alg_key_lenshould be unsigned to avoid integer divides
<http://git2.kernel.org/?p=linux/kernel/git/davem/net-2.6.git;a=commitdiff;h=ba749ae98d5aa9d2ce9a7facde0deed454f92230>)alg_key_lenfield of structxfrm_algowas converted to unsigned int to avoid integer divides.
Quoted 8 lines
Then Herbert in commit
1a6509d991225ad210de54c63314fd9542922095([IPSEC]: Add support for combined mode algorithms) added a new structurexfrm_algo_aead, that resurrected a signed int foralg_key_lenand re-introduce integer divides.This patch avoids these divides and saves 64 bytes of text on i386.
Signed-off-by Eric Dumazet <[email protected]>
I actually wrote my patch before yours was merged which was why it was signed.
Cheers,
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtQuoted 8 lines · Herbert Xu
Acked-by Herbert Xu <[email protected]>I actually wrote my patch before yours was merged which was why it was signed.
Cheers,
No problem Herbert, this is a minor cleanup after all :)
From: Herbert Xu <[email protected]>
Date: Fri, 25 Apr 2008 15:14:20 +0800
Quoted 12 lines · Eric Dumazet
Quoted 11 lines
In commit
ba749ae98d5aa9d2ce9a7facde0deed454f92230([XFRM]:alg_key_lenshould be unsigned to avoid integer divides
<http://git2.kernel.org/?p=linux/kernel/git/davem/net-2.6.git;a=commitdiff;h=ba749ae98d5aa9d2ce9a7facde0deed454f92230>)alg_key_lenfield of structxfrm_algowas converted to unsigned int to avoid integer divides.Then Herbert in commit
1a6509d991225ad210de54c63314fd9542922095([IPSEC]: Add support for combined mode algorithms) added a new structurexfrm_algo_aead, that resurrected a signed int foralg_key_lenand re-introduce integer divides.
Quoted 8 lines
Quoted 3 lines
This patch avoids these divides and saves 64 bytes of text on i386.
Signed-off-by Eric Dumazet <[email protected]>Acked-by Herbert Xu <[email protected]>I actually wrote my patch before yours was merged which was why it was signed.
Applied, thanks everyone.