Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932471AbYBMShx (ORCPT ); Wed, 13 Feb 2008 13:37:53 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1764471AbYBMShg (ORCPT ); Wed, 13 Feb 2008 13:37:36 -0500 Received: from hu-out-0506.google.com ([72.14.214.239]:56123 "EHLO hu-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762782AbYBMShf (ORCPT ); Wed, 13 Feb 2008 13:37:35 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=UH/8SaNoV3JJW5kS7hHpgDM1KLcHzY5hv1Dmatp45bRLBWnFksr+Q29VaprqJOAdai+m2XUmyXMXIqZWvzulE0JwGUL/Xul0dWSpn8PTFj+lb64JPwbGWstqwppxu3Oq8QTSmL9UkG52PpiVZApKz/8Mhczd8wl0LANW/ZN5dgA= Date: Wed, 13 Feb 2008 19:36:49 +0100 From: Marcin Slusarz To: Roel Kluin <12o3l@tiscali.nl> Cc: LKML , Herbert Xu , "David S. Miller" Subject: Re: [PATCH] crypto: be*_add_cpu conversion Message-ID: <20080213183628.GB6150@joi> References: <1202857582-15450-1-git-send-email-marcin.slusarz@gmail.com> <1202857582-15450-2-git-send-email-marcin.slusarz@gmail.com> <47B2A98B.4050408@tiscali.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47B2A98B.4050408@tiscali.nl> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2451 Lines: 80 On Wed, Feb 13, 2008 at 09:25:47AM +0100, Roel Kluin wrote: > marcin.slusarz@gmail.com wrote: > > From: Marcin Slusarz > > > > 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 > > Cc: Herbert Xu > > Cc: David S. Miller > > --- > > 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) > I'm a bit ashamed... but here is updated patch: --- crypto: replace all adds to big endians variables with be*_add_cpu 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); Signed-off-by: Marcin Slusarz Cc: Herbert Xu Cc: David S. Miller Cc: Roel Kluin <12o3l@tiscali.nl> --- crypto/lrw.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto/lrw.c b/crypto/lrw.c index 9d52e58..8ef664e 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) -- 1.5.3.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/