From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Mon, 7 May 2018 20:45:20 -0400 Subject: [U-Boot] [U-Boot,v2,1/4] regmap: clean up regmap allocation In-Reply-To: <1524107644-28849-2-git-send-email-yamada.masahiro@socionext.com> References: <1524107644-28849-2-git-send-email-yamada.masahiro@socionext.com> Message-ID: <20180508004520.GM12235@bill-the-cat.ec.rr.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Apr 19, 2018 at 12:14:01PM +0900, Masahiro Yamada wrote: > Putting zero length array at the end of struct is a common technique > to embed arbitrary length of members. There is no good reason to let > regmap_alloc_count() branch by "if (count <= 1)". > > As far as I understood the code, regmap->base is an alias of > regmap->ranges[0].start, but it is not helpful but make the code > just ugly. > > Rename regmap_alloc_count() to regmap_alloc() because the _count > suffix seems pointless. > > Signed-off-by: Masahiro Yamada > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: