From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Mon, 22 Oct 2018 13:25:37 -0400 Subject: [U-Boot] nand: atmel: Initialize pmecc smu with correct size In-Reply-To: <1538990864-26421-1-git-send-email-bmeng.cn@gmail.com> References: <1538990864-26421-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <20181022172537.GD1032@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, Oct 08, 2018 at 02:27:44AM -0700, Bin Meng wrote: > Currently in pmecc_get_sigma(), the code tries to clear the memory > pointed by smu with wrong size 'sizeof(int16_t) * ARRAY_SIZE(smu)'. > Since smu is actually a pointer, not an array, so ARRAY_SIZE(smu) > does not generate correct size to be cleared. > > In fact, GCC 8.1.0 reports a warning against it: > > error: division 'sizeof (int16_t * {aka short int *}) / sizeof (int16_t > {aka short int})' does not compute the number of array elements > [-Werror=sizeof-pointer-div] > > Fix it by using the correct size. > > Signed-off-by: Bin Meng > Reviewed-by: Miquel Raynal 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: