mtd: core: Constify buf in mtd_write_user_prot_reg()
authorTudor Ambarus <tudor.ambarus@microchip.com>
Sat, 3 Apr 2021 06:09:31 +0000 (09:09 +0300)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 16 Apr 2021 18:30:54 +0000 (20:30 +0200)
commit1df1fc8c62f7527d953c7f3869930067bf5b3f29
treeb683a6e18b43e5a37f47bbbdb2cfb27d54056cde
parentef4ed780d005d65b1a70ba7803233cace93a73ac
mtd: core: Constify buf in mtd_write_user_prot_reg()

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@microchip.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210403060931.7119-1-tudor.ambarus@microchip.com
drivers/mtd/chips/cfi_cmdset_0001.c
drivers/mtd/chips/cfi_cmdset_0002.c
drivers/mtd/devices/mtd_dataflash.c
drivers/mtd/mtdcore.c
drivers/mtd/nand/onenand/onenand_base.c
drivers/mtd/spi-nor/core.h
drivers/mtd/spi-nor/otp.c
include/linux/mtd/mtd.h