Re: [U-Boot] [PATCH] part_dos: allocate sector buffer dynamically

2011-05-12 Thread Wolfgang Denk
Dear Sergei Shtylyov, In message <4dbff9fd.1070...@mvista.com> you wrote: > > > Umm... you _are_ aware that you can put dynamically sized arrays on > > the stack, aren't you? > > No, it seems I'm not. Is it a standard C now? It's been a GCC extension forever (well, I have to admit that I do

Re: [U-Boot] [PATCH] part_dos: allocate sector buffer dynamically

2011-05-03 Thread Sergei Shtylyov
Hello. On 03-05-2011 16:34, Wolfgang Denk wrote: > Umm... you _are_ aware that you can put dynamically sized arrays on > the stack, aren't you? No, it seems I'm not. Is it a standard C now? > Best regards, > Wolfgang Denk WBR, Sergei ___ U-Boot

Re: [U-Boot] [PATCH] part_dos: allocate sector buffer dynamically

2011-05-03 Thread Wolfgang Denk
Dear Sergei Shtylyov, In message <4dbff300.9010...@mvista.com> you wrote: > > > Can we please keep the buffer on the stack as before? > > It will be unsafe. We can't really predict the size of the buffer (unless > we postulate that the buffer size won't ever exceed e.g. 4K). In which way w

Re: [U-Boot] [PATCH] part_dos: allocate sector buffer dynamically

2011-05-03 Thread Sergei Shtylyov
Hello. On 30-04-2011 23:14, Wolfgang Denk wrote: >> Apple iPod nanos have sector sizes of 2 or 4 KiB, which crashes U-Boot when >> it >> tries to read the MBR into 512-byte buffer situated on stack. Instead >> allocate >> this buffer dynamically to be safe with any large sector size. >> Signed

Re: [U-Boot] [PATCH] part_dos: allocate sector buffer dynamically

2011-04-30 Thread Wolfgang Denk
Dear Sergei Shtylyov, In message <201104122323.59105.sshtyl...@ru.mvista.com> you wrote: > Apple iPod nanos have sector sizes of 2 or 4 KiB, which crashes U-Boot when it > tries to read the MBR into 512-byte buffer situated on stack. Instead allocate > this buffer dynamically to be safe with any l