X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=crypto%2Flrw.c;h=8ef664e3bcd9a90c93a5436e551549e72df1ff82;hb=849c529f57020cc47085400edd5e641d95cd4faf;hp=621095db28b354fa314acb44528f514baf026cf5;hpb=4d4700707c0d4be0efc968989fb1cd01c60c0a35;p=linux-2.6 diff --git a/crypto/lrw.c b/crypto/lrw.c index 621095db28..8ef664e3bc 100644 --- a/crypto/lrw.c +++ b/crypto/lrw.c @@ -91,8 +91,9 @@ struct sinfo { static inline void inc(be128 *iv) { - if (!(iv->b = cpu_to_be64(be64_to_cpu(iv->b) + 1))) - iv->a = cpu_to_be64(be64_to_cpu(iv->a) + 1); + be64_add_cpu(&iv->b, 1); + if (!iv->b) + be64_add_cpu(&iv->a, 1); } static inline void lrw_round(struct sinfo *s, void *dst, const void *src) @@ -241,7 +242,7 @@ static struct crypto_instance *alloc(struct rtattr **tb) alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, CRYPTO_ALG_TYPE_MASK); if (IS_ERR(alg)) - return ERR_PTR(PTR_ERR(alg)); + return ERR_CAST(alg); inst = crypto_alloc_instance("lrw", alg); if (IS_ERR(inst))