Re: [PATCH] mtd: core: Constify buf in mtd_write_user_prot_reg()

From: Miquel Raynal
Date: Fri Apr 16 2021 - 14:33:43 EST

Hi Tudor,

Tudor Ambarus <tudor.ambarus@xxxxxxxxxxxxx> wrote on Sat, 3 Apr 2021
09:09:31 +0300:

> The write buffer comes from user and should be const.
> Constify write buffer in mtd core and across all _write_user_prot_reg()
> users. cfi_cmdset_{0001, 0002} and onenand_base will pay the cost of an
> explicit cast to discard the const qualifier since the beginning, since
> they are using an otp_op_t function prototype that is used for both reads
> and writes. mtd_dataflash and SPI NOR will benefit of the const buffer
> because they are using different paths for writes and reads.
> Signed-off-by: Tudor Ambarus <tudor.ambarus@xxxxxxxxxxxxx>

Applied on top of mtd/next after the merge of all our internal PR's.