linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: constify elements of NAND_OP_PARSER(_PATTERN)
@ 2019-04-09  4:53 Masahiro Yamada
  2019-04-09  9:54 ` Boris Brezillon
  2019-04-18 16:21 ` Miquel Raynal
  0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2019-04-09  4:53 UTC (permalink / raw)
  To: linux-mtd, Miquel Raynal
  Cc: Masahiro Yamada, Richard Weinberger, Boris Brezillon,
	linux-kernel, Marek Vasut, Brian Norris, David Woodhouse

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: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 include/linux/mtd/rawnand.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
index b7445a44a814..ebde52088e4d 100644
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -805,7 +805,7 @@ struct nand_op_parser_pattern {
 #define NAND_OP_PARSER_PATTERN(_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__ }) /	\
 			  sizeof(struct nand_op_parser_pattern_elem),				\
 	}
@@ -831,7 +831,7 @@ struct 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__ }) /	\
 			     sizeof(struct nand_op_parser_pattern),				\
 	}
-- 
2.17.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd: rawnand: constify elements of NAND_OP_PARSER(_PATTERN)
  2019-04-09  4:53 [PATCH] mtd: rawnand: constify elements of NAND_OP_PARSER(_PATTERN) Masahiro Yamada
@ 2019-04-09  9:54 ` Boris Brezillon
  2019-04-18 16:21 ` Miquel Raynal
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2019-04-09  9:54 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Boris Brezillon, Richard Weinberger, linux-kernel, Marek Vasut,
	linux-mtd, Miquel Raynal, Brian Norris, David Woodhouse

On Tue,  9 Apr 2019 13:53:32 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:

> 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: Masahiro Yamada <yamada.masahiro@socionext.com>

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

> ---
> 
>  include/linux/mtd/rawnand.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
> index b7445a44a814..ebde52088e4d 100644
> --- a/include/linux/mtd/rawnand.h
> +++ b/include/linux/mtd/rawnand.h
> @@ -805,7 +805,7 @@ struct nand_op_parser_pattern {
>  #define NAND_OP_PARSER_PATTERN(_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__ }) /	\
>  			  sizeof(struct nand_op_parser_pattern_elem),				\
>  	}
> @@ -831,7 +831,7 @@ struct 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__ }) /	\
>  			     sizeof(struct nand_op_parser_pattern),				\
>  	}


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd: rawnand: constify elements of NAND_OP_PARSER(_PATTERN)
  2019-04-09  4:53 [PATCH] mtd: rawnand: constify elements of NAND_OP_PARSER(_PATTERN) Masahiro Yamada
  2019-04-09  9:54 ` Boris Brezillon
@ 2019-04-18 16:21 ` Miquel Raynal
  1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2019-04-18 16:21 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Boris Brezillon, Richard Weinberger, linux-kernel, Marek Vasut,
	linux-mtd, Brian Norris, David Woodhouse

Hi Masahiro,

Masahiro Yamada <yamada.masahiro@socionext.com> wrote on Tue,  9 Apr
2019 13:53:32 +0900:

> 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: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 

Applied to 
https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git 
branch nand/next.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-18 16:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-09  4:53 [PATCH] mtd: rawnand: constify elements of NAND_OP_PARSER(_PATTERN) Masahiro Yamada
2019-04-09  9:54 ` Boris Brezillon
2019-04-18 16:21 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).