From 9a371639fc5346e58b34294c51126264eac9767c Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 20 May 2024 14:03:21 +0200 Subject: [PATCH] cleanup: relocate section Move _features[] structure from .data.rel.ro to .rodata. --- lib/cache_segtype/cache.c | 12 ++++++------ lib/raid/raid.c | 10 +++++----- lib/thin/thin.c | 8 ++++---- lib/vdo/vdo.c | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c index b6c47b07b..52a21ef4a 100644 --- a/lib/cache_segtype/cache.c +++ b/lib/cache_segtype/cache.c @@ -307,13 +307,13 @@ static int _target_present(struct cmd_context *cmd, { /* List of features with their kernel target version */ static const struct feature { - uint32_t maj; - uint32_t min; - unsigned cache_feature; - unsigned cache_alias; + uint16_t maj; + uint16_t min; + uint16_t cache_feature; + uint16_t cache_alias; const char feature[12]; const char module[12]; /* check dm-%s */ - const char *aliasing; + const char aliasing[24]; } _features[] = { { 1, 10, CACHE_FEATURE_METADATA2, 0, "metadata2" }, /* Assumption: cache >=1.9 always aliases MQ policy */ @@ -369,7 +369,7 @@ static int _target_present(struct cmd_context *cmd, module_present(cmd, _features[i].module)) { log_debug_activation("Cache policy %s is available%s.", _features[i].module, - _features[i].aliasing ? : ""); + _features[i].aliasing); _attrs |= (_features[i].cache_feature | _features[i].cache_alias); } else if (!_features[i].cache_alias) log_very_verbose("Target %s does not support %s.", diff --git a/lib/raid/raid.c b/lib/raid/raid.c index 9732c3dd5..dac7a791b 100644 --- a/lib/raid/raid.c +++ b/lib/raid/raid.c @@ -508,11 +508,11 @@ out: /* Define raid feature based on the tuple(major, minor, patchlevel) of raid target */ struct raid_feature { - uint32_t maj; - uint32_t min; - uint32_t patchlevel; - unsigned raid_feature; - const char *feature; + uint16_t maj; + uint16_t min; + uint16_t patchlevel; + uint16_t raid_feature; + const char feature[24]; }; /* Return true if tuple(@maj, @min, @patchlevel) is greater/equal to @*feature members */ diff --git a/lib/thin/thin.c b/lib/thin/thin.c index eba2cce30..b8c6f3acc 100644 --- a/lib/thin/thin.c +++ b/lib/thin/thin.c @@ -660,10 +660,10 @@ static int _thin_target_present(struct cmd_context *cmd, { /* List of features with their kernel target version */ static const struct feature { - uint32_t maj; - uint32_t min; - unsigned thin_feature; - const char *feature; + uint16_t maj; + uint16_t min; + uint16_t thin_feature; + const char feature[24]; } _features[] = { { 1, 1, THIN_FEATURE_DISCARDS, "discards" }, { 1, 1, THIN_FEATURE_EXTERNAL_ORIGIN, "external_origin" }, diff --git a/lib/vdo/vdo.c b/lib/vdo/vdo.c index 75a73eb57..8fdaae514 100644 --- a/lib/vdo/vdo.c +++ b/lib/vdo/vdo.c @@ -421,11 +421,11 @@ static int _vdo_target_present(struct cmd_context *cmd, { /* List of features with their kernel target version */ static const struct feature { - uint32_t maj; - uint32_t min; - uint32_t patchlevel; - unsigned vdo_feature; - const char *feature; + uint16_t maj; + uint16_t min; + uint16_t patchlevel; + uint16_t vdo_feature; + const char feature[24]; } _features[] = { { 6, 2, 3, VDO_FEATURE_ONLINE_RENAME, "online_rename" }, { 8, 2, 0, VDO_FEATURE_VERSION4, "version4" },