mtd: spinand: Constify struct nand_ecc_engine_ops
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 18 Oct 2024 17:05:57 +0000 (19:05 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 21 Oct 2024 09:55:50 +0000 (11:55 +0200)
commitaf264e5989055ac33f413c4c80874345cda0cc97
tree3512cae14199c41630e01bcc7fea88599beb8a15
parent7b2e57c26d45d55aa00d9f2904db12633596ffdb
mtd: spinand: Constify struct nand_ecc_engine_ops

'struct nand_ecc_engine_ops' are not modified in these drivers.

Constifying this structure moves some data to a read-only section, so
increases overall security, especially when the structure holds some
function pointers.

Update the prototype of mxic_ecc_get_pipelined_ops() accordingly.

On a x86_64, with allmodconfig, as an example:
Before:
======
   text    data     bss     dec     hex filename
  16709    1374      16   18099    46b3 drivers/mtd/nand/ecc-mxic.o

After:
=====
   text    data     bss     dec     hex filename
  16789    1294      16   18099    46b3 drivers/mtd/nand/ecc-mxic.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/72597e9de2320a4109be2112e696399592edacd4.1729271136.git.christophe.jaillet@wanadoo.fr
drivers/mtd/nand/ecc-mxic.c
drivers/mtd/nand/ecc-sw-bch.c
drivers/mtd/nand/ecc-sw-hamming.c
drivers/mtd/nand/spi/core.c
drivers/spi/spi-mtk-snfi.c
drivers/spi/spi-mxic.c
include/linux/mtd/nand-ecc-mxic.h
include/linux/mtd/nand.h