From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miquel Raynal Date: Tue, 9 Oct 2018 09:47:33 +0200 Subject: [U-Boot] [PATCH] 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: <20181009094733.695674d3@xps13> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de Hi Bin, Bin Meng wrote on Mon, 8 Oct 2018 02:27:44 -0700: > 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. >=20 > In fact, GCC 8.1.0 reports a warning against it: >=20 > error: division 'sizeof (int16_t * {aka short int *}) / sizeof (int16_t > {aka short int})' does not compute the number of array elements > [-Werror=3Dsizeof-pointer-div] >=20 > Fix it by using the correct size. >=20 > Signed-off-by: Bin Meng > --- >=20 It's curious that the code of this driver differs a lot from its Linux cousin. Anyway this looks fine by me. Maybe a Fixes tag would be great. Reviewed-by: Miquel Raynal Thanks, Miqu=C3=A8l