From: Florian Fainelli Subject: Re: [RFT][PATCH 4/7] net: dsa: microchip: Remove dev->txbuf Date: Wed, 19 Dec 2018 17:20:33 -0800 Message-ID: References: <20181220010647.4059-1-marex@denx.de> <20181220010647.4059-5-marex@denx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: andrew@lunn.ch, Tristram Ha , Woojung Huh To: Marek Vasut , netdev@vger.kernel.org Return-path: Received: from mail-yw1-f68.google.com ([209.85.161.68]:39376 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726716AbeLTBUh (ORCPT ); Wed, 19 Dec 2018 20:20:37 -0500 Received: by mail-yw1-f68.google.com with SMTP id j6so32164ywj.6 for ; Wed, 19 Dec 2018 17:20:36 -0800 (PST) In-Reply-To: <20181220010647.4059-5-marex@denx.de> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: 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