On 12/19/18 5:06 PM, Marek Vasut wrote:
> Previous patches unconver that ksz_spi_write() is always ever called
> with len = 1, 2 or 4. We can thus drop the if (len > SPI_TX_BUF_LEN)
> check and we can also drop the allocation of the txbuf which is part
> of the driver data. This wastes 256 bytes for no reason and can be
> replaced with 8-byte stack allocated buffer, which is what this patch
> does. This is an intermediate step though, which will go away after
> regmap conversion.

dev is a kmalloc'd buffer, so dev->txbuf is a DMA-able buffer, that
could be presumably why it was used in the first place, DMA from the
stack is not something safe, but I did not check the core SPI layer or
the SPI bus master driver to see whether they do take care of that already.
-- 
Florian

Reply via email to