提交 f56cad5f 编写于 作者: M Masahiro Yamada 提交者: Miquel Raynal

mtd: rawnand: constify elements of NAND_OP_PARSER(_PATTERN)

Currently, drivers are able to constify a nand_op_parser array,
but not nand_op_parser_pattern and nand_op_parser_pattern_elem
since they are instantiated by using the NAND_OP_PARSER(_PATTERN).

Add 'const' to them in order to move more driver data from .data to
.rodata section.
Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
上级 2e16dc73
...@@ -806,7 +806,7 @@ struct nand_op_parser_pattern { ...@@ -806,7 +806,7 @@ struct nand_op_parser_pattern {
#define NAND_OP_PARSER_PATTERN(_exec, ...) \ #define NAND_OP_PARSER_PATTERN(_exec, ...) \
{ \ { \
.exec = _exec, \ .exec = _exec, \
.elems = (struct nand_op_parser_pattern_elem[]) { __VA_ARGS__ }, \ .elems = (const struct nand_op_parser_pattern_elem[]) { __VA_ARGS__ }, \
.nelems = sizeof((struct nand_op_parser_pattern_elem[]) { __VA_ARGS__ }) / \ .nelems = sizeof((struct nand_op_parser_pattern_elem[]) { __VA_ARGS__ }) / \
sizeof(struct nand_op_parser_pattern_elem), \ sizeof(struct nand_op_parser_pattern_elem), \
} }
...@@ -832,7 +832,7 @@ struct nand_op_parser { ...@@ -832,7 +832,7 @@ struct nand_op_parser {
#define NAND_OP_PARSER(...) \ #define NAND_OP_PARSER(...) \
{ \ { \
.patterns = (struct nand_op_parser_pattern[]) { __VA_ARGS__ }, \ .patterns = (const struct nand_op_parser_pattern[]) { __VA_ARGS__ }, \
.npatterns = sizeof((struct nand_op_parser_pattern[]) { __VA_ARGS__ }) / \ .npatterns = sizeof((struct nand_op_parser_pattern[]) { __VA_ARGS__ }) / \
sizeof(struct nand_op_parser_pattern), \ sizeof(struct nand_op_parser_pattern), \
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册