linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gen_init_cpio: add static const qualifiers
@ 2021-10-12  2:55 Masahiro Yamada
  2021-10-12 20:16 ` Nicolas Schier
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2021-10-12  2:55 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

Add 'const' to constant arrays. I also added missing 'static'.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 usr/gen_init_cpio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c
index 03b21189d58b..bf5b98c6cf8d 100644
--- a/usr/gen_init_cpio.c
+++ b/usr/gen_init_cpio.c
@@ -188,7 +188,7 @@ struct generic_type {
 	mode_t mode;
 };
 
-static struct generic_type generic_type_table[] = {
+static const struct generic_type generic_type_table[] = {
 	[GT_DIR] = {
 		.type = "dir",
 		.mode = S_IFDIR
@@ -491,7 +491,7 @@ static void usage(const char *prog)
 		prog);
 }
 
-struct file_handler file_handler_table[] = {
+static const struct file_handler file_handler_table[] = {
 	{
 		.type    = "file",
 		.handler = cpio_mkfile_line,
-- 
2.30.2


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

* Re: [PATCH] gen_init_cpio: add static const qualifiers
  2021-10-12  2:55 [PATCH] gen_init_cpio: add static const qualifiers Masahiro Yamada
@ 2021-10-12 20:16 ` Nicolas Schier
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Schier @ 2021-10-12 20:16 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-kbuild, linux-kernel

On ti. 12. okt. 2021 kl. 11.55 +0000 Masahiro Yamada wrote:
> Add 'const' to constant arrays. I also added missing 'static'.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>

> ---
> 
>  usr/gen_init_cpio.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c
> index 03b21189d58b..bf5b98c6cf8d 100644
> --- a/usr/gen_init_cpio.c
> +++ b/usr/gen_init_cpio.c
> @@ -188,7 +188,7 @@ struct generic_type {
>  	mode_t mode;
>  };
>  
> -static struct generic_type generic_type_table[] = {
> +static const struct generic_type generic_type_table[] = {
>  	[GT_DIR] = {
>  		.type = "dir",
>  		.mode = S_IFDIR
> @@ -491,7 +491,7 @@ static void usage(const char *prog)
>  		prog);
>  }
>  
> -struct file_handler file_handler_table[] = {
> +static const struct file_handler file_handler_table[] = {
>  	{
>  		.type    = "file",
>  		.handler = cpio_mkfile_line,
> -- 
> 2.30.2
> 

-- 
epost|xmpp: nicolas@fjasle.eu          irc://oftc.net/nsc
↳ gpg: 18ed 52db e34f 860e e9fb  c82b 7d97 0932 55a0 ce7f
     -- frykten for herren er opphav til kunnskap --

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

end of thread, other threads:[~2021-10-12 20:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-12  2:55 [PATCH] gen_init_cpio: add static const qualifiers Masahiro Yamada
2021-10-12 20:16 ` Nicolas Schier

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).