Skip to content

Commit f4e99b8

Browse files
C2RedhatMikulas Patocka
authored andcommitted
dm vdo indexer: prevent unterminated string warning
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>
1 parent 3280c93 commit f4e99b8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/md/dm-vdo/indexer/index-layout.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
* Each save also has a unique nonce.
5555
*/
5656

57-
#define MAGIC_SIZE 32
5857
#define NONCE_INFO_SIZE 32
5958
#define MAX_SAVES 2
6059

@@ -98,9 +97,11 @@ enum region_type {
9897
#define SUPER_VERSION_CURRENT 3
9998
#define SUPER_VERSION_MAXIMUM 7
10099

101-
static const u8 LAYOUT_MAGIC[MAGIC_SIZE] = "*ALBIREO*SINGLE*FILE*LAYOUT*001*";
100+
static const u8 LAYOUT_MAGIC[] = "*ALBIREO*SINGLE*FILE*LAYOUT*001*";
102101
static const u64 REGION_MAGIC = 0x416c6252676e3031; /* 'AlbRgn01' */
103102

103+
#define MAGIC_SIZE (sizeof(LAYOUT_MAGIC) - 1)
104+
104105
struct region_header {
105106
u64 magic;
106107
u64 region_blocks;

0 commit comments

Comments
 (0)