aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTino Reichardt <[email protected]>2022-10-18 20:05:32 +0200
committerGitHub <[email protected]>2022-10-18 11:05:32 -0700
commit27218a32fc5eb6661996204af3d43fd97c9bda4d (patch)
treefb62db56b74c85df681f381a3d0574cbedd26b35 /tests
parentab49df487b5dfee8d045195c30d3bf1b00c23910 (diff)
Fix declarations of non-global variables
This patch inserts the `static` keyword to non-global variables, which where found by the analysis tool smatch. Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tino Reichardt <[email protected]> Closes #13970
Diffstat (limited to 'tests')
-rw-r--r--tests/zfs-tests/cmd/btree_test.c10
-rw-r--r--tests/zfs-tests/cmd/checksum/edonr_test.c18
-rw-r--r--tests/zfs-tests/cmd/checksum/sha2_test.c20
-rw-r--r--tests/zfs-tests/cmd/checksum/skein_test.c16
-rw-r--r--tests/zfs-tests/cmd/mmap_libaio.c2
5 files changed, 33 insertions, 33 deletions
diff --git a/tests/zfs-tests/cmd/btree_test.c b/tests/zfs-tests/cmd/btree_test.c
index fb9de9c77..9a34bf559 100644
--- a/tests/zfs-tests/cmd/btree_test.c
+++ b/tests/zfs-tests/cmd/btree_test.c
@@ -23,11 +23,11 @@
#define BUFSIZE 256
-int seed = 0;
-int stress_timeout = 180;
-int contents_frequency = 100;
-int tree_limit = 64 * 1024;
-boolean_t stress_only = B_FALSE;
+static int seed = 0;
+static int stress_timeout = 180;
+static int contents_frequency = 100;
+static int tree_limit = 64 * 1024;
+static boolean_t stress_only = B_FALSE;
static void
usage(int exit_value)
diff --git a/tests/zfs-tests/cmd/checksum/edonr_test.c b/tests/zfs-tests/cmd/checksum/edonr_test.c
index 3a0a48533..d010fbfcd 100644
--- a/tests/zfs-tests/cmd/checksum/edonr_test.c
+++ b/tests/zfs-tests/cmd/checksum/edonr_test.c
@@ -40,16 +40,16 @@
* Test messages from:
* http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA_All.pdf
*/
-const char *test_msg0 = "abc";
-const char *test_msg1 = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmn"
- "lmnomnopnopq";
-const char *test_msg2 = "abcdefghbcdefghicdefghijdefghijkefghijklfghi"
- "jklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
+static const char *test_msg0 = "abc";
+static const char *test_msg1 = "abcdbcdecdefdefgefghfghighijhijkijkljklmklm"
+ "nlmnomnopnopq";
+static const char *test_msg2 = "abcdefghbcdefghicdefghijdefghijkefghijklfgh"
+ "ijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
/*
* Test digests computed by hand. There's no formal standard or spec for edonr.
*/
-const uint8_t edonr_224_test_digests[][28] = {
+static const uint8_t edonr_224_test_digests[][28] = {
{
/* for test_msg0 */
0x56, 0x63, 0xc4, 0x93, 0x95, 0x20, 0xfa, 0xf6,
@@ -67,7 +67,7 @@ const uint8_t edonr_224_test_digests[][28] = {
/* no test vector for test_msg2 */
};
-const uint8_t edonr_256_test_digests[][32] = {
+static const uint8_t edonr_256_test_digests[][32] = {
{
/* for test_msg0 */
0x54, 0xd7, 0x8b, 0x13, 0xc7, 0x4e, 0xda, 0x5a,
@@ -85,7 +85,7 @@ const uint8_t edonr_256_test_digests[][32] = {
/* no test vectorfor test_msg2 */
};
-const uint8_t edonr_384_test_digests[][48] = {
+static const uint8_t edonr_384_test_digests[][48] = {
{
/* for test_msg0 */
0x0e, 0x7c, 0xd7, 0x85, 0x78, 0x77, 0xe0, 0x89,
@@ -110,7 +110,7 @@ const uint8_t edonr_384_test_digests[][48] = {
}
};
-const uint8_t edonr_512_test_digests[][64] = {
+static const uint8_t edonr_512_test_digests[][64] = {
{
/* for test_msg0 */
0x1b, 0x14, 0xdb, 0x15, 0x5f, 0x1d, 0x40, 0x65,
diff --git a/tests/zfs-tests/cmd/checksum/sha2_test.c b/tests/zfs-tests/cmd/checksum/sha2_test.c
index bb3553110..d99e8757a 100644
--- a/tests/zfs-tests/cmd/checksum/sha2_test.c
+++ b/tests/zfs-tests/cmd/checksum/sha2_test.c
@@ -44,17 +44,17 @@
* http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA_All.pdf
*/
-const char *test_msg0 = "abc";
-const char *test_msg1 = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmn"
- "lmnomnopnopq";
-const char *test_msg2 = "abcdefghbcdefghicdefghijdefghijkefghijklfghi"
- "jklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
+static const char *test_msg0 = "abc";
+static const char *test_msg1 = "abcdbcdecdefdefgefghfghighijhijkijkljklmklm"
+ "nlmnomnopnopq";
+static const char *test_msg2 = "abcdefghbcdefghicdefghijdefghijkefghijklfgh"
+ "ijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
/*
* Test digests from:
* http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA_All.pdf
*/
-const uint8_t sha256_test_digests[][32] = {
+static const uint8_t sha256_test_digests[][32] = {
{
/* for test_msg0 */
0xBA, 0x78, 0x16, 0xBF, 0x8F, 0x01, 0xCF, 0xEA,
@@ -72,7 +72,7 @@ const uint8_t sha256_test_digests[][32] = {
/* no test vector for test_msg2 */
};
-const uint8_t sha384_test_digests[][48] = {
+static const uint8_t sha384_test_digests[][48] = {
{
/* for test_msg0 */
0xCB, 0x00, 0x75, 0x3F, 0x45, 0xA3, 0x5E, 0x8B,
@@ -97,7 +97,7 @@ const uint8_t sha384_test_digests[][48] = {
}
};
-const uint8_t sha512_test_digests[][64] = {
+static const uint8_t sha512_test_digests[][64] = {
{
/* for test_msg0 */
0xDD, 0xAF, 0x35, 0xA1, 0x93, 0x61, 0x7A, 0xBA,
@@ -126,7 +126,7 @@ const uint8_t sha512_test_digests[][64] = {
}
};
-const uint8_t sha512_224_test_digests[][28] = {
+static const uint8_t sha512_224_test_digests[][28] = {
{
/* for test_msg0 */
0x46, 0x34, 0x27, 0x0F, 0x70, 0x7B, 0x6A, 0x54,
@@ -147,7 +147,7 @@ const uint8_t sha512_224_test_digests[][28] = {
}
};
-const uint8_t sha512_256_test_digests[][32] = {
+static const uint8_t sha512_256_test_digests[][32] = {
{
/* for test_msg0 */
0x53, 0x04, 0x8E, 0x26, 0x81, 0x94, 0x1E, 0xF9,
diff --git a/tests/zfs-tests/cmd/checksum/skein_test.c b/tests/zfs-tests/cmd/checksum/skein_test.c
index 13611c860..20eb36d3e 100644
--- a/tests/zfs-tests/cmd/checksum/skein_test.c
+++ b/tests/zfs-tests/cmd/checksum/skein_test.c
@@ -44,18 +44,18 @@
/*
* Test messages from the Skein spec, Appendix C.
*/
-const uint8_t test_msg0[] = {
+static const uint8_t test_msg0[] = {
0xFF
};
-const uint8_t test_msg1[] = {
+static const uint8_t test_msg1[] = {
0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8,
0xF7, 0xF6, 0xF5, 0xF4, 0xF3, 0xF2, 0xF1, 0xF0,
0xEF, 0xEE, 0xED, 0xEC, 0xEB, 0xEA, 0xE9, 0xE8,
0xE7, 0xE6, 0xE5, 0xE4, 0xE3, 0xE2, 0xE1, 0xE0
};
-const uint8_t test_msg2[] = {
+static const uint8_t test_msg2[] = {
0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8,
0xF7, 0xF6, 0xF5, 0xF4, 0xF3, 0xF2, 0xF1, 0xF0,
0xEF, 0xEE, 0xED, 0xEC, 0xEB, 0xEA, 0xE9, 0xE8,
@@ -66,7 +66,7 @@ const uint8_t test_msg2[] = {
0xC7, 0xC6, 0xC5, 0xC4, 0xC3, 0xC2, 0xC1, 0xC0
};
-const uint8_t test_msg3[] = {
+static const uint8_t test_msg3[] = {
0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8,
0xF7, 0xF6, 0xF5, 0xF4, 0xF3, 0xF2, 0xF1, 0xF0,
0xEF, 0xEE, 0xED, 0xEC, 0xEB, 0xEA, 0xE9, 0xE8,
@@ -85,7 +85,7 @@ const uint8_t test_msg3[] = {
0x87, 0x86, 0x85, 0x84, 0x83, 0x82, 0x81, 0x80
};
-const uint8_t test_msg4[] = {
+static const uint8_t test_msg4[] = {
0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8,
0xF7, 0xF6, 0xF5, 0xF4, 0xF3, 0xF2, 0xF1, 0xF0,
0xEF, 0xEE, 0xED, 0xEC, 0xEB, 0xEA, 0xE9, 0xE8,
@@ -123,7 +123,7 @@ const uint8_t test_msg4[] = {
/*
* Test digests from the Skein spec, Appendix C.
*/
-const uint8_t skein_256_test_digests[][32] = {
+static const uint8_t skein_256_test_digests[][32] = {
{
/* for test_msg0 */
0x0B, 0x98, 0xDC, 0xD1, 0x98, 0xEA, 0x0E, 0x50,
@@ -148,7 +148,7 @@ const uint8_t skein_256_test_digests[][32] = {
/* no test digests for test_msg3 and test_msg4 */
};
-const uint8_t skein_512_test_digests[][64] = {
+static const uint8_t skein_512_test_digests[][64] = {
{
/* for test_msg0 */
0x71, 0xB7, 0xBC, 0xE6, 0xFE, 0x64, 0x52, 0x22,
@@ -189,7 +189,7 @@ const uint8_t skein_512_test_digests[][64] = {
/* no test digests for test_msg4 */
};
-const uint8_t skein_1024_test_digests[][128] = {
+static const uint8_t skein_1024_test_digests[][128] = {
{
/* for test_msg0 */
0xE6, 0x2C, 0x05, 0x80, 0x2E, 0xA0, 0x15, 0x24,
diff --git a/tests/zfs-tests/cmd/mmap_libaio.c b/tests/zfs-tests/cmd/mmap_libaio.c
index 7d76c9b4e..5ee1f600a 100644
--- a/tests/zfs-tests/cmd/mmap_libaio.c
+++ b/tests/zfs-tests/cmd/mmap_libaio.c
@@ -33,7 +33,7 @@
#include <libaio.h>
#include <err.h>
-io_context_t io_ctx;
+static io_context_t io_ctx;
static void
do_sync_io(struct iocb *iocb)