From: Matt Roper <matthew.d.roper@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: matthew.d.roper@intel.com, Ashutosh Dixit <ashutosh.dixit@intel.com>
Subject: [PATCH i-g-t] tests/intel: Drop unused local variables
Date: Thu, 1 Aug 2024 15:52:24 -0700 [thread overview]
Message-ID: <20240801225224.3744479-1-matthew.d.roper@intel.com> (raw)
After applying igt.cocci to the Intel tests, several open-coded swap
implementations were replaced with calls to igt_swap, leaving behind
unused local variables. Drop those variables to eliminate the compiler
warnings.
Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Fixes: dd461382e ("tests/intel: Apply igt.cocci transforms")
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
tests/intel/gem_ctx_create.c | 4 ++--
tests/intel/gem_exec_big.c | 1 -
tests/intel/gem_exec_gttfill.c | 1 -
tests/intel/gem_softpin.c | 1 -
tests/intel/gem_tiled_fence_blits.c | 2 +-
5 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/tests/intel/gem_ctx_create.c b/tests/intel/gem_ctx_create.c
index 0332ecbb9..5c2b0ef65 100644
--- a/tests/intel/gem_ctx_create.c
+++ b/tests/intel/gem_ctx_create.c
@@ -295,14 +295,14 @@ static void active(int fd, const intel_ctx_cfg_t *cfg,
static void xchg_u32(void *array, unsigned i, unsigned j)
{
- uint32_t *a = array, tmp;
+ uint32_t *a = array;
igt_swap(a[i], a[j]);
}
static void xchg_ptr(void *array, unsigned i, unsigned j)
{
- void **a = array, *tmp;
+ void **a = array;
igt_swap(a[i], a[j]);
}
diff --git a/tests/intel/gem_exec_big.c b/tests/intel/gem_exec_big.c
index 86849f322..cdefce5db 100644
--- a/tests/intel/gem_exec_big.c
+++ b/tests/intel/gem_exec_big.c
@@ -141,7 +141,6 @@ static void xchg_reloc(void *array, unsigned i, unsigned j)
struct drm_i915_gem_relocation_entry *reloc = array;
struct drm_i915_gem_relocation_entry *a = &reloc[i];
struct drm_i915_gem_relocation_entry *b = &reloc[j];
- struct drm_i915_gem_relocation_entry tmp;
igt_swap(*a, *b);
}
diff --git a/tests/intel/gem_exec_gttfill.c b/tests/intel/gem_exec_gttfill.c
index ff600e0ca..3f0501777 100644
--- a/tests/intel/gem_exec_gttfill.c
+++ b/tests/intel/gem_exec_gttfill.c
@@ -64,7 +64,6 @@ struct batch {
static void xchg_batch(void *array, unsigned int i, unsigned int j)
{
struct batch *batches = array;
- struct batch tmp;
igt_swap(batches[i], batches[j]);
}
diff --git a/tests/intel/gem_softpin.c b/tests/intel/gem_softpin.c
index c542bf741..d8b99a2ae 100644
--- a/tests/intel/gem_softpin.c
+++ b/tests/intel/gem_softpin.c
@@ -967,7 +967,6 @@ struct batch {
static void xchg_batch(void *array, unsigned int i, unsigned int j)
{
struct batch *batches = array;
- struct batch tmp;
igt_swap(batches[i], batches[j]);
}
diff --git a/tests/intel/gem_tiled_fence_blits.c b/tests/intel/gem_tiled_fence_blits.c
index f5a3d9311..c11eb73e3 100644
--- a/tests/intel/gem_tiled_fence_blits.c
+++ b/tests/intel/gem_tiled_fence_blits.c
@@ -156,7 +156,7 @@ update_batch(int fd, uint32_t bb_handle,
static void xchg_u32(void *array, unsigned i, unsigned j)
{
- uint32_t tmp, *base = array;
+ uint32_t *base = array;
igt_swap(base[i], base[j]);
}
--
2.45.2
next reply other threads:[~2024-08-01 22:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-01 22:52 Matt Roper [this message]
2024-08-01 23:17 ` [PATCH i-g-t] tests/intel: Drop unused local variables Dixit, Ashutosh
2024-08-01 23:37 ` ✓ CI.xeBAT: success for " Patchwork
2024-08-01 23:45 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-08-02 7:45 ` Saarinen, Jani
2024-08-02 10:26 ` Illipilli, TejasreeX
2024-08-02 2:07 ` ✗ CI.xeFULL: " Patchwork
2024-08-02 10:00 ` ✓ Fi.CI.BAT: success " Patchwork
2024-08-02 20:26 ` ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240801225224.3744479-1-matthew.d.roper@intel.com \
--to=matthew.d.roper@intel.com \
--cc=ashutosh.dixit@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox