lkml.org 
[lkml]   [2008]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] crypto: be*_add_cpu conversion
marcin.slusarz@gmail.com wrote:
> From: Marcin Slusarz <marcin.slusarz@gmail.com>
>
> replace all:
> big_endian_variable = cpu_to_beX(beX_to_cpu(big_endian_variable) +
> expression_in_cpu_byteorder);
> with:
> beX_add_cpu(&big_endian_variable, expression_in_cpu_byteorder);
> generated with semantic patch
>
> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: David S. Miller <davem@davemloft.net>
> ---
> crypto/lrw.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/crypto/lrw.c b/crypto/lrw.c
> index 9d52e58..4d93928 100644
> --- a/crypto/lrw.c
> +++ b/crypto/lrw.c
> @@ -92,7 +92,7 @@ struct sinfo {
> static inline void inc(be128 *iv)
> {
> if (!(iv->b = cpu_to_be64(be64_to_cpu(iv->b) + 1)))

maybe you also want instead of the line above:

be64_add_cpu(&iv->b, 1);
if (!iv->b)

> - iv->a = cpu_to_be64(be64_to_cpu(iv->a) + 1);
> + be64_add_cpu(&iv->a, 1);
> }
>
> static inline void lrw_round(struct sinfo *s, void *dst, const void *src)



\
 
 \ /
  Last update: 2008-02-13 09:29    [W:0.229 / U:2.036 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site