From ff699eab24b67547d1d77307719f9d3ea1f04d8a Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 3 May 2024 14:43:22 +0200 Subject: [PATCH] const: _ops text_vg_version --- lib/format_text/import-export.h | 2 +- lib/format_text/import.c | 10 +++++----- lib/format_text/import_vsn1.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/format_text/import-export.h b/lib/format_text/import-export.h index da76852b7..e37f3a3a5 100644 --- a/lib/format_text/import-export.h +++ b/lib/format_text/import-export.h @@ -61,7 +61,7 @@ struct text_vg_version_ops { struct lvmcache_vgsummary *vgsummary); }; -struct text_vg_version_ops *text_vg_vsn1_init(void); +const struct text_vg_version_ops *text_vg_vsn1_init(void); int print_flags(char *buffer, size_t size, enum pv_vg_lv_e type, int mask, uint64_t status); int read_flags(uint64_t *status, enum pv_vg_lv_e type, int mask, const struct dm_config_value *cv); diff --git a/lib/format_text/import.c b/lib/format_text/import.c index a3735369d..5f74ae420 100644 --- a/lib/format_text/import.c +++ b/lib/format_text/import.c @@ -19,7 +19,7 @@ #include "import-export.h" /* FIXME Use tidier inclusion method */ -static struct text_vg_version_ops *(_text_vsn_list[2]); +static const struct text_vg_version_ops *(_text_vsn_list[2]); static int _text_import_initialised = 0; @@ -45,7 +45,7 @@ int text_read_metadata_summary(const struct format_type *fmt, struct lvmcache_vgsummary *vgsummary) { struct dm_config_tree *cft; - struct text_vg_version_ops **vsn; + const struct text_vg_version_ops **vsn; int r = 0; _init_text_import(); @@ -117,7 +117,7 @@ struct volume_group *text_read_metadata(struct format_instance *fid, { struct volume_group *vg = NULL; struct dm_config_tree *cft; - struct text_vg_version_ops **vsn; + const struct text_vg_version_ops **vsn; int skip_parse; /* @@ -219,7 +219,7 @@ static struct volume_group *_import_vg_from_config_tree(struct cmd_context *cmd, const struct dm_config_tree *cft) { struct volume_group *vg = NULL; - struct text_vg_version_ops **vsn; + const struct text_vg_version_ops **vsn; int vg_missing; _init_text_import(); @@ -256,7 +256,7 @@ struct volume_group *import_vg_from_config_tree(struct cmd_context *cmd, struct volume_group *vg_from_config_tree(struct cmd_context *cmd, const struct dm_config_tree *cft) { - static struct text_vg_version_ops *ops; + const struct text_vg_version_ops *ops; _init_text_import(); diff --git a/lib/format_text/import_vsn1.c b/lib/format_text/import_vsn1.c index dacf5573e..0bba8772a 100644 --- a/lib/format_text/import_vsn1.c +++ b/lib/format_text/import_vsn1.c @@ -1359,14 +1359,14 @@ static int _read_vgsummary(const struct format_type *fmt, const struct dm_config return 1; } -static struct text_vg_version_ops _vsn1_ops = { +static const struct text_vg_version_ops _vsn1_ops = { .check_version = _vsn1_check_version, .read_vg = _read_vg, .read_desc = _read_desc, .read_vgsummary = _read_vgsummary }; -struct text_vg_version_ops *text_vg_vsn1_init(void) +const struct text_vg_version_ops *text_vg_vsn1_init(void) { return &_vsn1_ops; }