From f44154dd7ce158656dc3fa6a48086d93a7dffd33 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sun, 22 Jan 2023 14:27:24 +0000 Subject: [PATCH] blkpr: mark data const --- sys-utils/blkpr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys-utils/blkpr.c b/sys-utils/blkpr.c index 2665988052..e9b50ccd64 100644 --- a/sys-utils/blkpr.c +++ b/sys-utils/blkpr.c @@ -41,7 +41,7 @@ struct type_string { }; /* This array should keep align with enum pr_type of linux/types.h */ -static struct type_string pr_type[] = { +static const struct type_string pr_type[] = { {PR_WRITE_EXCLUSIVE, "write-exclusive", " * write-exclusive: Only the initiator that owns the reservation can\n" " write to the device. Any initiator can read from the device.\n"}, @@ -72,7 +72,7 @@ static struct type_string pr_type[] = { " a reservation holder if you want to use this type.\n"} }; -static struct type_string pr_command[] = { +static const struct type_string pr_command[] = { {IOC_PR_REGISTER, "register", " * register: This command registers a new reservation if the key argument\n" " is non-null. If no existing reservation exists oldkey must be zero, if\n" @@ -105,14 +105,14 @@ static struct type_string pr_command[] = { " key registered with the device and drops any existing reservation.\n"}, }; -static struct type_string pr_flag[] = { +static const struct type_string pr_flag[] = { {PR_FL_IGNORE_KEY, "ignore-key", " * ignore-key: Ignore the existing reservation key. This is commonly\n" " supported for register command, and some implementation may support\n" " the flag for reserve command.\n"} }; -static void print_type(FILE *out, struct type_string *ts, size_t nmem) +static void print_type(FILE *out, const struct type_string *ts, size_t nmem) { size_t i; @@ -122,7 +122,7 @@ static void print_type(FILE *out, struct type_string *ts, size_t nmem) } -static int parse_type_by_str(struct type_string *ts, int nmem, char *pattern) +static int parse_type_by_str(const struct type_string *ts, int nmem, char *pattern) { int i; -- 2.47.3