summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorChung Chung <cchung@redhat.com>2025-01-29 18:27:12 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-05-29 11:03:04 +0200
commitf8b4edbcf353117acd5f63702d9ea53c820b2365 (patch)
tree2f97ee40e1af55c3d968fa2122e07fd8dde92a05 /drivers/md
parent0cc2aa747208558c618e5afe06df8362eaf7b9e5 (diff)
downloadlinux-f8b4edbcf353117acd5f63702d9ea53c820b2365.tar.gz
linux-f8b4edbcf353117acd5f63702d9ea53c820b2365.tar.bz2
linux-f8b4edbcf353117acd5f63702d9ea53c820b2365.zip
dm vdo indexer: prevent unterminated string warning
[ Upstream commit f4e99b846c90163d350c69d6581ac38dd5818eb8 ] Fix array initialization that triggers a warning: error: initializer-string for array of ‘unsigned char’ is too long [-Werror=unterminated-string-initialization] Signed-off-by: Chung Chung <cchung@redhat.com> Signed-off-by: Matthew Sakai <msakai@redhat.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-vdo/indexer/index-layout.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/dm-vdo/indexer/index-layout.c b/drivers/md/dm-vdo/indexer/index-layout.c
index 627adc24af3b..053b7845d1f3 100644
--- a/drivers/md/dm-vdo/indexer/index-layout.c
+++ b/drivers/md/dm-vdo/indexer/index-layout.c
@@ -54,7 +54,6 @@
* Each save also has a unique nonce.
*/
-#define MAGIC_SIZE 32
#define NONCE_INFO_SIZE 32
#define MAX_SAVES 2
@@ -98,9 +97,11 @@ enum region_type {
#define SUPER_VERSION_CURRENT 3
#define SUPER_VERSION_MAXIMUM 7
-static const u8 LAYOUT_MAGIC[MAGIC_SIZE] = "*ALBIREO*SINGLE*FILE*LAYOUT*001*";
+static const u8 LAYOUT_MAGIC[] = "*ALBIREO*SINGLE*FILE*LAYOUT*001*";
static const u64 REGION_MAGIC = 0x416c6252676e3031; /* 'AlbRgn01' */
+#define MAGIC_SIZE (sizeof(LAYOUT_MAGIC) - 1)
+
struct region_header {
u64 magic;
u64 region_blocks;