Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757696Ab2EXQh6 (ORCPT ); Thu, 24 May 2012 12:37:58 -0400 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:33300 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750864Ab2EXQh5 (ORCPT ); Thu, 24 May 2012 12:37:57 -0400 Date: Thu, 24 May 2012 17:37:53 +0100 From: Mark Brown To: Marc Reilly Cc: Shawn Guo , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Fabio Estevam , Samuel Ortiz , Sascha Hauer , Philippe =?iso-8859-1?Q?R=E9tornaz?= , linux-kernel Subject: Re: mc13xxx-core: kernel hangs after 'regmap_read' Message-ID: <20120524163752.GN5361@opensource.wolfsonmicro.com> References: <201205221053.21792.marc@cpdesign.com.au> <201205242122.29648.marc@cpdesign.com.au> <20120524121451.GL5361@opensource.wolfsonmicro.com> <201205242306.09053.marc@cpdesign.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201205242306.09053.marc@cpdesign.com.au> X-Cookie: You will get what you deserve. User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 670 Lines: 15 On Thu, May 24, 2012 at 11:06:08PM +1000, Marc Reilly wrote: > - map->format.buf_size = (config->reg_bits + config->val_bits) / 8; > + map->format.buf_size = DIV_ROUND_UP(config->reg_bits + > + config->val_bits + > + config->pad_bits % 8, 8); Yup, though probably without the % 8 (I'd need to reread the context to confirm) as if pad_bits isn't a multiple of 8 you ought to find that reg_bits isn't either. -- 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/