[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7a754275-94be-9b6f-0d66-a72faaec13f7@microchip.com>
Date: Thu, 25 Jul 2019 13:35:38 +0000
From: <Tudor.Ambarus@...rochip.com>
To: <boris.brezillon@...labora.com>
CC: <vigneshr@...com>, <miquel.raynal@...tlin.com>, <richard@....at>,
<marek.vasut@...il.com>, <bbrezillon@...nel.org>,
<yogeshnarayan.gaur@....com>, <linux-kernel@...r.kernel.org>,
<linux-mtd@...ts.infradead.org>
Subject: Re: [PATCH v2 1/2] mtd: spi-nor: Move m25p80 code in spi-nor.c
On 07/25/2019 04:17 PM, Tudor Ambarus wrote:
>>>> +static ssize_t spi_nor_spimem_xfer_data(struct spi_nor *nor,
>>>> + struct spi_mem_op *op,
>>>> + enum spi_nor_protocol proto)
>>>> +{
>>>> + bool usebouncebuf = false;
>>> declare bool at the end to avoid stack padding.
>> But it breaks the reverse-xmas-tree formatting :-).
>>
>>>> + void *rdbuf = NULL;
>>>> + const void *buf;
>>> you can get rid of rdbuf and buf if you pass buf as argument.
>> Hm, passing the buffer to send data from/receive data into is already
>> part of the spi_mem_op definition process (which is done in the caller
>> of this func) so why bother passing an extra arg to the function.
>> Note that you had the exact opposite argument for the
>> spi_nor_spimem_xfer_reg() prototype you suggested above (which I
>> agree with BTW) :P.
> In order to avoid if clauses like "if (op->data.dir == SPI_MEM_DATA_IN)". You
> can't use op->data.buf directly, the *out const qualifier can be discarded.
I'm wrong, the const qualifier will be discarded when passing the buf argument.
Please ignore.
Powered by blists - more mailing lists