Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 2/2] tests/intel: Apply igt.cocci transforms
Date: Thu, 01 Aug 2024 14:46:01 -0700	[thread overview]
Message-ID: <85wmkz7w86.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20240729220251.3353533-2-matthew.d.roper@intel.com>

On Mon, 29 Jul 2024 15:02:51 -0700, Matt Roper wrote:
>
> A number of Intel tests are using checks like "igt_assert(x < y)" rather
> than using the dedicated comparison assertions that print the actual
> values on assertion failure.  Run the Intel test directory through
> Coccinelle to apply these conversions and also apply some other general
> coding style cleanup:
>
>        spatch --in-place --sp-file lib/igt.cocci tests/intel


Seems to have caused a bunch of unused variable warnings:

$ gcc --version
gcc (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4)

ninja: Entering directory `build'
[34/912] Compiling C object tests/drm_fdinfo.p/intel_drm_fdinfo.c.o
In file included from ../lib/igt.h:29,
                 from ../tests/intel/drm_fdinfo.c:28:
../tests/intel/drm_fdinfo.c: In function ‘read_fdinfo’:
../lib/igt_aux.h:229:35: warning: comparison of distinct pointer types lacks a cast
  229 |         (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
      |                                   ^~
../lib/igt_aux.h:246:10: note: in expansion of macro ‘__typecheck’
  246 |         (__typecheck(x, y) && __no_side_effects(x, y))
      |          ^~~~~~~~~~~
../lib/igt_aux.h:249:31: note: in expansion of macro ‘__safe_cmp’
  249 |         __builtin_choose_expr(__safe_cmp(x, y), \
      |                               ^~~~~~~~~~
../lib/igt_aux.h:254:25: note: in expansion of macro ‘__careful_cmp’
  254 | #define max(x, y)       __careful_cmp(x, y, >, max)
      |                         ^~~~~~~~~~~~~
../tests/intel/drm_fdinfo.c:808:16: note: in expansion of macro ‘max’
  808 |         return max(count, 0);
      |                ^~~
[35/912] Compiling C object tests/gem_ctx_create.p/intel_gem_ctx_create.c.o
../tests/intel/gem_ctx_create.c: In function ‘xchg_u32’:
../tests/intel/gem_ctx_create.c:298:30: warning: unused variable ‘tmp’ [-Wunused-variable]
  298 |         uint32_t *a = array, tmp;
      |                              ^~~
../tests/intel/gem_ctx_create.c: In function ‘xchg_ptr’:
../tests/intel/gem_ctx_create.c:305:28: warning: unused variable ‘tmp’ [-Wunused-variable]
  305 |         void **a = array, *tmp;
      |                            ^~~
[36/912] Compiling C object tests/gem_exec_big.p/intel_gem_exec_big.c.o
../tests/intel/gem_exec_big.c: In function ‘xchg_reloc’:
../tests/intel/gem_exec_big.c:144:46: warning: unused variable ‘tmp’ [-Wunused-variable]
  144 |         struct drm_i915_gem_relocation_entry tmp;
      |                                              ^~~
[37/912] Compiling C object tests/gem_exec_gttfill.p/intel_gem_exec_gttfill.c.o
../tests/intel/gem_exec_gttfill.c: In function ‘xchg_batch’:
../tests/intel/gem_exec_gttfill.c:67:22: warning: unused variable ‘tmp’ [-Wunused-variable]
   67 |         struct batch tmp;
      |                      ^~~
[38/912] Compiling C object tests/gem_softpin.p/intel_gem_softpin.c.o
../tests/intel/gem_softpin.c: In function ‘xchg_batch’:
../tests/intel/gem_softpin.c:970:22: warning: unused variable ‘tmp’ [-Wunused-variable]
  970 |         struct batch tmp;
      |                      ^~~
[39/912] Compiling C object tests/gem_tiled_fence_blits.p/intel_gem_tiled_fence_blits.c.o
../tests/intel/gem_tiled_fence_blits.c: In function ‘xchg_u32’:
../tests/intel/gem_tiled_fence_blits.c:159:18: warning: unused variable ‘tmp’ [-Wunused-variable]
  159 |         uint32_t tmp, *base = array;
      |                  ^~~

  parent reply	other threads:[~2024-08-01 21:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29 22:02 [PATCH i-g-t 1/2] lib: Add u32 variants of igt_assert_{lt,lte} Matt Roper
2024-07-29 22:02 ` [PATCH i-g-t 2/2] tests/intel: Apply igt.cocci transforms Matt Roper
2024-07-31 12:25   ` [i-g-t,2/2] " Vivekanandan, Balasubramani
2024-07-31 16:26     ` Matt Roper
2024-08-01 10:19       ` Vivekanandan, Balasubramani
2024-08-01 21:46   ` Dixit, Ashutosh [this message]
2024-07-29 22:43 ` ✓ CI.xeBAT: success for series starting with [i-g-t,1/2] lib: Add u32 variants of igt_assert_{lt,lte} Patchwork
2024-07-29 23:13 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-07-29 23:24   ` Matt Roper
2024-07-30  2:16 ` ✗ CI.xeFULL: " Patchwork
2024-07-30 15:44   ` Matt Roper
2024-07-31 15:57 ` [PATCH i-g-t 1/2] " Kamil Konieczny

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=85wmkz7w86.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    /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