Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964828AbWIWUgq (ORCPT ); Sat, 23 Sep 2006 16:36:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751518AbWIWUgq (ORCPT ); Sat, 23 Sep 2006 16:36:46 -0400 Received: from smtpout.mac.com ([17.250.248.184]:26102 "EHLO smtpout.mac.com") by vger.kernel.org with ESMTP id S1751516AbWIWUgp (ORCPT ); Sat, 23 Sep 2006 16:36:45 -0400 In-Reply-To: <20060923144041.GA3540@gondor.apana.org.au> References: <20060922.223136.41635862.davem@davemloft.net> <20060923124633.GA2567@gondor.apana.org.au> <20060923125458.GA2682@gondor.apana.org.au> <20060923144041.GA3540@gondor.apana.org.au> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <0C3FEC03-29A8-49B0-9D12-BBFA4AE99A78@mac.com> Cc: David Miller , linux-kernel@vger.kernel.org, torvalds@osdl.org Content-Transfer-Encoding: 7bit From: Kyle Moffett Subject: Re: [PATCH]: Fix ALIGN() macro Date: Sat, 23 Sep 2006 16:36:33 -0400 To: Herbert Xu X-Mailer: Apple Mail (2.752.2) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1035 Lines: 32 On Sep 23, 2006, at 10:40:41, Herbert Xu wrote: > diff --git a/crypto/hmac.c b/crypto/hmac.c > index f403b69..d52b234 100644 > --- a/crypto/hmac.c > +++ b/crypto/hmac.c > @@ -98,7 +98,7 @@ static int hmac_init(struct hash_desc *p > sg_set_buf(&tmp, ipad, bs); > > return unlikely(crypto_hash_init(&desc)) ?: > - crypto_hash_update(&desc, &tmp, 1); > + crypto_hash_update(&desc, &tmp, bs); > } > > static int hmac_update(struct hash_desc *pdesc, Quick question: does "crypto_hash_init()" ever return anything other than 0 or 1? If so this is a subtle bug, as "unlikely()" is implemented like this: # define unlikely(x) __builtin_expect(!!(x), 0) IMO any usage of likely/unlikely other than if(unlikely()), if(likely ()) is probably a bug. Cheers, Kyle Moffett - 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/