Skip to content

Commit 9631350

Browse files
Li Qiangmiquelraynal
authored andcommitted
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>
1 parent 0d9c80a commit 9631350

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mtd/nand/ecc-realtek.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ static void rtl_ecc_cleanup_ctx(struct nand_device *nand)
380380
nand_ecc_cleanup_req_tweaking(&ctx->req_ctx);
381381
}
382382

383-
static struct nand_ecc_engine_ops rtl_ecc_engine_ops = {
383+
static const struct nand_ecc_engine_ops rtl_ecc_engine_ops = {
384384
.init_ctx = rtl_ecc_init_ctx,
385385
.cleanup_ctx = rtl_ecc_cleanup_ctx,
386386
.prepare_io_req = rtl_ecc_prepare_io_req,

0 commit comments

Comments
 (0)