[4/7] test: remove unused variables

Submitted by Rikard Falkeborn on April 28, 2019, 6:22 p.m.

Details

Message ID 20190428182255.5641-5-rikard.falkeborn@gmail.com
State Accepted
Series "Misc fixes found by cppcheck"
Commit 59e1f1636ff7c86791305e01e05631d0e465d0a4
Headers show

Commit Message

Rikard Falkeborn April 28, 2019, 6:22 p.m.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 test/others/bers/bers.c          | 4 +---
 test/others/libcriu/test_errno.c | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/test/others/bers/bers.c b/test/others/bers/bers.c
index 208325c6..0954868f 100644
--- a/test/others/bers/bers.c
+++ b/test/others/bers/bers.c
@@ -93,7 +93,6 @@  static int sys_gettid(void)
 static void dirtify_memory(unsigned long *chunks, size_t nr_chunks,
 			   size_t chunk_size, int mode, const size_t nr_pages)
 {
-	void *page;
 	size_t i;
 
 	pr_trace("filling memory\n");
@@ -115,7 +114,7 @@  static void dirtify_memory(unsigned long *chunks, size_t nr_chunks,
 static void dirtify_files(int *fd, size_t nr_files, size_t size)
 {
 	size_t buf[8192];
-	size_t i, j, c;
+	size_t i;
 
 	/*
 	 * Note we don't write any _sane_ data here, the only
@@ -265,7 +264,6 @@  int main(int argc, char *argv[])
 	char workdir[PATH_MAX];
 	int opt, idx, pidfd;
 	char pidbuf[32];
-	int status;
 	pid_t pid;
 	size_t i;
 
diff --git a/test/others/libcriu/test_errno.c b/test/others/libcriu/test_errno.c
index e0914430..8bd19fe2 100644
--- a/test/others/libcriu/test_errno.c
+++ b/test/others/libcriu/test_errno.c
@@ -56,7 +56,7 @@  static int no_process(void)
 	size_t len;
 	ssize_t count;
 	char *buf = NULL;
-	int pid, fd, ret;
+	int pid, ret;
 
 	printf("--- Try to dump unexisting process\n");
 

Comments

Dmitry Safonov April 29, 2019, 2:52 p.m.
On Sun, 28 Apr 2019 at 19:45, Rikard Falkeborn
<rikard.falkeborn@gmail.com> wrote:
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>

Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>

> ---
>  test/others/bers/bers.c          | 4 +---
>  test/others/libcriu/test_errno.c | 2 +-
>  2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/test/others/bers/bers.c b/test/others/bers/bers.c
> index 208325c6..0954868f 100644
> --- a/test/others/bers/bers.c
> +++ b/test/others/bers/bers.c
> @@ -93,7 +93,6 @@ static int sys_gettid(void)
>  static void dirtify_memory(unsigned long *chunks, size_t nr_chunks,
>                            size_t chunk_size, int mode, const size_t nr_pages)
>  {
> -       void *page;
>         size_t i;
>
>         pr_trace("filling memory\n");
> @@ -115,7 +114,7 @@ static void dirtify_memory(unsigned long *chunks, size_t nr_chunks,
>  static void dirtify_files(int *fd, size_t nr_files, size_t size)
>  {
>         size_t buf[8192];
> -       size_t i, j, c;
> +       size_t i;
>
>         /*
>          * Note we don't write any _sane_ data here, the only
> @@ -265,7 +264,6 @@ int main(int argc, char *argv[])
>         char workdir[PATH_MAX];
>         int opt, idx, pidfd;
>         char pidbuf[32];
> -       int status;
>         pid_t pid;
>         size_t i;
>
> diff --git a/test/others/libcriu/test_errno.c b/test/others/libcriu/test_errno.c
> index e0914430..8bd19fe2 100644
> --- a/test/others/libcriu/test_errno.c
> +++ b/test/others/libcriu/test_errno.c
> @@ -56,7 +56,7 @@ static int no_process(void)
>         size_t len;
>         ssize_t count;
>         char *buf = NULL;
> -       int pid, fd, ret;
> +       int pid, ret;
>
>         printf("--- Try to dump unexisting process\n");
>
> --
> 2.21.0
>
> _______________________________________________
> CRIU mailing list
> CRIU@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu