Re: [U-Boot] [PATCH 17/17] spi: Avoid using malloc() in a critical function

2019-05-20 Thread Simon Glass
Hi Urja, On Mon, 20 May 2019 at 10:36, Urja Rannikko wrote: > > Hi Simon, > > On Mon, May 20, 2019 at 7:09 PM Simon Glass wrote: > > > > Hi Urja, > > > Is it possible to add a build-time assert for this somewhere? > I'm not sure, you'd need to check every user of these operations - i > was goin

Re: [U-Boot] [PATCH 17/17] spi: Avoid using malloc() in a critical function

2019-05-20 Thread Urja Rannikko
Hi Simon, On Mon, May 20, 2019 at 7:09 PM Simon Glass wrote: > > Hi Urja, > Is it possible to add a build-time assert for this somewhere? I'm not sure, you'd need to check every user of these operations - i was going to suggest just bailing out with an error code or a runtime assert, and going t

Re: [U-Boot] [PATCH 17/17] spi: Avoid using malloc() in a critical function

2019-05-20 Thread Simon Glass
Hi Urja, On Sun, 19 May 2019 at 11:04, Urja Rannikko wrote: > > Hi, > > On Sat, May 18, 2019 at 6:05 PM Simon Glass wrote: > > > > In general we should avoid calling malloc() and free() repeatedly in > > U-Boot lest we turn it into tianocore. In SPL this can make SPI flash > > unusable since fre

Re: [U-Boot] [PATCH 17/17] spi: Avoid using malloc() in a critical function

2019-05-19 Thread Urja Rannikko
Hi, On Sat, May 18, 2019 at 6:05 PM Simon Glass wrote: > > In general we should avoid calling malloc() and free() repeatedly in > U-Boot lest we turn it into tianocore. In SPL this can make SPI flash > unusable since free() is often a nop and allocation space is limited. > > In any case, these se

[U-Boot] [PATCH 17/17] spi: Avoid using malloc() in a critical function

2019-05-18 Thread Simon Glass
In general we should avoid calling malloc() and free() repeatedly in U-Boot lest we turn it into tianocore. In SPL this can make SPI flash unusable since free() is often a nop and allocation space is limited. In any case, these seems no need for malloc() since the number of bytes is very small, pe