dm vdo: fix sparse warnings about missing statics
authorMike Snitzer <snitzer@kernel.org>
Tue, 6 Feb 2024 02:04:16 +0000 (21:04 -0500)
committerMike Snitzer <snitzer@kernel.org>
Tue, 20 Feb 2024 18:43:18 +0000 (13:43 -0500)
Addresses various sparse warnings like:
warning: symbol 'SYMBOL' was not declared. Should it be static?

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Susan LeGendre-McGhee <slegendr@redhat.com>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
drivers/md/dm-vdo/Makefile
drivers/md/dm-vdo/block-map.c
drivers/md/dm-vdo/constants.c [deleted file]
drivers/md/dm-vdo/constants.h
drivers/md/dm-vdo/encodings.c

index 8f8d161a6dbe16ccfd4534aa9ed342db549f964b..8c06c3b969e3ef7892ca653cdd92574f2c498c5c 100644 (file)
@@ -9,7 +9,6 @@ dm-vdo-objs := \
        chapter-index.o \
        completion.o \
        config.o \
-       constants.o \
        data-vio.o \
        dedupe.o \
        delta-index.o \
index 54ad6939cab72e2ef1dc040712eb8dbe44c45f40..1278a5791160ea90487c334a4be480e6c7e36081 100644 (file)
@@ -67,7 +67,7 @@ struct block_map_tree_segment {
 
 struct block_map_tree {
        struct block_map_tree_segment *segments;
-} block_map_tree;
+};
 
 struct forest {
        struct block_map *map;
diff --git a/drivers/md/dm-vdo/constants.c b/drivers/md/dm-vdo/constants.c
deleted file mode 100644 (file)
index 14ac047..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright 2023 Red Hat
- */
-
-#include "types.h"
-
-/* The maximum logical space is 4 petabytes, which is 1 terablock. */
-const block_count_t MAXIMUM_VDO_LOGICAL_BLOCKS = 1024ULL * 1024 * 1024 * 1024;
-
-/* The maximum physical space is 256 terabytes, which is 64 gigablocks. */
-const block_count_t MAXIMUM_VDO_PHYSICAL_BLOCKS = 1024ULL * 1024 * 1024 * 64;
-
-/* unit test minimum */
-const block_count_t MINIMUM_VDO_SLAB_JOURNAL_BLOCKS = 2;
index 9ae3917d00de74b56d2d488bd85974bdac33100b..3a997dd7d0b12aa76fbef60b64aaf711aa91b29e 100644 (file)
@@ -91,12 +91,12 @@ enum {
 };
 
 /** The maximum logical space is 4 petabytes, which is 1 terablock. */
-extern const block_count_t MAXIMUM_VDO_LOGICAL_BLOCKS;
+static const block_count_t MAXIMUM_VDO_LOGICAL_BLOCKS = 1024ULL * 1024 * 1024 * 1024;
 
 /** The maximum physical space is 256 terabytes, which is 64 gigablocks. */
-extern const block_count_t MAXIMUM_VDO_PHYSICAL_BLOCKS;
+static const block_count_t MAXIMUM_VDO_PHYSICAL_BLOCKS = 1024ULL * 1024 * 1024 * 64;
 
 /** unit test minimum */
-extern const block_count_t MINIMUM_VDO_SLAB_JOURNAL_BLOCKS;
+static const block_count_t MINIMUM_VDO_SLAB_JOURNAL_BLOCKS = 2;
 
 #endif /* VDO_CONSTANTS_H */
index 2d9d8645f66bd54efedf289fd90d9ad18cabd3cd..6b3e9a5b3a91f47ec8aa2cf5d675d20c770bad94 100644 (file)
@@ -85,7 +85,7 @@ const struct header VDO_SLAB_DEPOT_HEADER_2_0 = {
        .size = sizeof(struct slab_depot_state_2_0),
 };
 
-const struct header VDO_LAYOUT_HEADER_3_0 = {
+static const struct header VDO_LAYOUT_HEADER_3_0 = {
        .id = VDO_LAYOUT,
        .version = {
                .major_version = 3,