summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Qiang <liqiang01@kylinos.cn>2025-10-20 20:53:33 +0800
committerMiquel Raynal <miquel.raynal@bootlin.com>2025-10-22 11:54:42 +0200
commit9631350885929819d4e46c6521df35960b472ef3 (patch)
treebd084f85e3dfd54f29fe916d5dc9fd7038ec406a
parent0d9c80aa572182d4b1464826cd77aa8973213216 (diff)
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>
-rw-r--r--drivers/mtd/nand/ecc-realtek.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/ecc-realtek.c b/drivers/mtd/nand/ecc-realtek.c
index 7c275f1eb4a7..0046da37ea3e 100644
--- a/drivers/mtd/nand/ecc-realtek.c
+++ b/drivers/mtd/nand/ecc-realtek.c
@@ -380,7 +380,7 @@ static void rtl_ecc_cleanup_ctx(struct nand_device *nand)
nand_ecc_cleanup_req_tweaking(&ctx->req_ctx);
}
-static struct nand_ecc_engine_ops rtl_ecc_engine_ops = {
+static const struct nand_ecc_engine_ops rtl_ecc_engine_ops = {
.init_ctx = rtl_ecc_init_ctx,
.cleanup_ctx = rtl_ecc_cleanup_ctx,
.prepare_io_req = rtl_ecc_prepare_io_req,