
12 Sep
2013
12 Sep
'13
8:39 p.m.
On Thu, Sep 12, 2013 at 3:17 PM, Wolfgang Denk wd@denx.de wrote:
Dear Marek Vasut,
In message 201309121605.04824.marex@denx.de you wrote:
Looking at the code one more time, it'd make most sense to simply allocate the buffer NOT on stack, but with some memalign-kind-of call to avoid this abuse of stack. You see, the max packet size is around 2k, which is quite a lot. How does this proposal sound to you ?
It makes perfect sense to allocate variable with function scope only on the stack. That's what the stack has been invented for.
This buffer in the fec driver will be used in DMA transfer, so maybe that's the reason we should use malloc instead of using the stack?
At least in the kernel, we don't use stack for DMA buffers.