Message ID | 20220424195636.842942-1-fontaine.fabrice@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | testcases/kernel/fs: declare int openlog as static | expand |
Hi! Pushed with a minor change, thanks. The variable is not used at all in the random-access-del-create.c so I removed it from there instead in order to avoid introducing new warnings.
diff --git a/testcases/kernel/fs/fs-bench/random-access-del-create.c b/testcases/kernel/fs/fs-bench/random-access-del-create.c index 1f62a76b5..8e21c7f74 100644 --- a/testcases/kernel/fs/fs-bench/random-access-del-create.c +++ b/testcases/kernel/fs/fs-bench/random-access-del-create.c @@ -11,7 +11,7 @@ #define FAIL 0 #define SUCCESS 1 -int openlog[2] = { 0, 0 }; +static int openlog[2] = { 0, 0 }; #define MAXNUM 0x100000 diff --git a/testcases/kernel/fs/fs-bench/random-access.c b/testcases/kernel/fs/fs-bench/random-access.c index cf41d6e81..c2f32b86e 100644 --- a/testcases/kernel/fs/fs-bench/random-access.c +++ b/testcases/kernel/fs/fs-bench/random-access.c @@ -11,7 +11,7 @@ #define FAIL 0 #define SUCCESS 1 -int openlog[2] = { 0, 0 }; +static int openlog[2] = { 0, 0 }; #define MAXNUM 0x100000 diff --git a/testcases/kernel/fs/fs-bench/random-del-create.c b/testcases/kernel/fs/fs-bench/random-del-create.c index 0a86f976f..345031f28 100644 --- a/testcases/kernel/fs/fs-bench/random-del-create.c +++ b/testcases/kernel/fs/fs-bench/random-del-create.c @@ -11,7 +11,7 @@ #define FAIL 0 #define SUCCESS 1 -int openlog[2] = { 0, 0 }; +static int openlog[2] = { 0, 0 }; #define MAXNUM 0x100000 diff --git a/testcases/kernel/fs/scsi/ltpfs/main.c b/testcases/kernel/fs/scsi/ltpfs/main.c index 2c67c7a47..90a5531ac 100644 --- a/testcases/kernel/fs/scsi/ltpfs/main.c +++ b/testcases/kernel/fs/scsi/ltpfs/main.c @@ -38,7 +38,7 @@ int startc = 0; int showchar[] = { 124, 47, 45, 92, 124, 47, 45, 92 }; int nullFileHandle; -int openlog[2] = { 0, 0 }; +static int openlog[2] = { 0, 0 }; int cFileCount, dFileCount, errorCount; static int disk_space_pool = 0;
Declare int openlog as static to avoid the following build failure when building statically (e.g. on buildroot): /nvmedata/autobuild/instance-15/output-1/per-package/ltp-testsuite/host/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/10.3.0/../../../../mipsel-buildroot-linux-uclibc/bin/ld: /nvmedata/autobuild/instance-15/output-1/per-package/ltp-testsuite/host/bin/../mipsel-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(syslog.os): in function `openlog': syslog.c:(.text+0x6b8): multiple definition of `openlog'; /tmp/ccvRnqfT.o:/nvmedata/autobuild/instance-15/output-1/build/ltp-testsuite-20220121/testcases/kernel/fs/fs-bench/random-access.c:14: first defined here Fixes: - http://autobuild.buildroot.org/results/bfd0d906a05564a4f323db604f3b908abf552b20 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> --- testcases/kernel/fs/fs-bench/random-access-del-create.c | 2 +- testcases/kernel/fs/fs-bench/random-access.c | 2 +- testcases/kernel/fs/fs-bench/random-del-create.c | 2 +- testcases/kernel/fs/scsi/ltpfs/main.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)