From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Thu, 9 Feb 2012 00:34:45 -0500 Subject: [U-Boot] [Samsung] [PATCH v7 4/4] EXYNOS: SMDK5250: Add MMC SPL support In-Reply-To: References: <1328173887-24983-1-git-send-email-chander.kashyap@linaro.org> <201202082251.44958.vapier@gentoo.org> Message-ID: <201202090034.48744.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thursday 09 February 2012 00:25:35 Chander Kashyap wrote: > On 9 February 2012 09:21, Mike Frysinger wrote: > > On Wednesday 08 February 2012 18:35:28 Doug Anderson wrote: > >> On Thu, Feb 2, 2012 at 1:21 PM, Mike Frysinger wrote: > >> > On Thursday 02 February 2012 04:11:27 Chander Kashyap wrote: > >> > > +int main(int argc, char **argv) > >> > > +{ > >> > > ... > >> > > + unsigned char buffer[BUFSIZE] = {0}; > >> > > >> > this is an implicit memset() and from what i can see in the code, > >> > useless. you read() the entire buffer, so there's no need to > >> > initialize it. > >> > >> Funny, I was just about to submit a patch to add this = {0} myself when > >> I found this message. ;) I would say that it (or a memset, whichever > >> people prefer) is a good idea so that this tool can be used to make a > >> reasonable SPL out of any source binary executable, even ones that are > >> smaller than 14K. > > > > you're right ... i'll claim that i was deceived by the lack of input > > checking. sounds like the code should be aborting if the input is too > > large instead of silently truncating. then the memset/{0} is > > unnecessary: > > - write out the data read > > - lseek to the checksum position > > - write checksum > > - ftruncate to total length (16KiB?) > > BUFSIZE is already made 14K, so no need to ftruncate. yes, in v9, it's 14KiB. i was looking at v7 which used 16KiB. -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: