OSDN Git Service

gen_init_cpio: add static const qualifiers
authorMasahiro Yamada <masahiroy@kernel.org>
Tue, 12 Oct 2021 02:55:14 +0000 (11:55 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 13 Oct 2021 02:00:09 +0000 (02:00 +0000)
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

index 03b2118..bf5b98c 100644 (file)
@@ -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,