Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: rawnand: realtek: Make rtl_ecc_engine_ops const

The rtl_ecc_engine_ops structure is only used to provide a set of
callback functions and is never modified after initialization.
Mark it as const so it can be placed in the read-only section, which
improves safety and allows better compiler optimization.

Signed-off-by: Li Qiang <liqiang01@kylinos.cn>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

authored by

Li Qiang and committed by
Miquel Raynal
96313508 0d9c80aa

+1 -1
+1 -1
drivers/mtd/nand/ecc-realtek.c
··· 380 380 nand_ecc_cleanup_req_tweaking(&ctx->req_ctx); 381 381 } 382 382 383 - static struct nand_ecc_engine_ops rtl_ecc_engine_ops = { 383 + static const struct nand_ecc_engine_ops rtl_ecc_engine_ops = { 384 384 .init_ctx = rtl_ecc_init_ctx, 385 385 .cleanup_ctx = rtl_ecc_cleanup_ctx, 386 386 .prepare_io_req = rtl_ecc_prepare_io_req,