diff mbox

[PACTH,i-g-t,v1] lib/igt_gt: Fix unused variable warning for non-x86 targets

Message ID 1467025104-32155-1-git-send-email-robert.foss@collabora.com (mailing list archive)
State New, archived
Headers show

Commit Message

Robert Foss June 27, 2016, 10:58 a.m. UTC
From: Robert Foss <robert.foss@collabora.com>

Moved variable declaration inside #if case to avoid unused variable warnings
on non-x86 targets.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
---
 lib/igt_gt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Chris Wilson June 29, 2016, 8:27 p.m. UTC | #1
On Mon, Jun 27, 2016 at 06:58:24AM -0400, robert.foss@collabora.com wrote:
> From: Robert Foss <robert.foss@collabora.com>
> 
> Moved variable declaration inside #if case to avoid unused variable warnings
> on non-x86 targets.
> 
> Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
Marius Vlad July 4, 2016, 2:35 p.m. UTC | #2
Applied.
On Mon, Jun 27, 2016 at 06:58:24AM -0400, robert.foss@collabora.com wrote:
> From: Robert Foss <robert.foss@collabora.com>
> 
> Moved variable declaration inside #if case to avoid unused variable warnings
> on non-x86 targets.
> 
> Signed-off-by: Robert Foss <robert.foss@collabora.com>
> ---
>  lib/igt_gt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/igt_gt.c b/lib/igt_gt.c
> index a3d6a73..8a53775 100644
> --- a/lib/igt_gt.c
> +++ b/lib/igt_gt.c
> @@ -383,9 +383,10 @@ int igt_open_forcewake_handle(void)
>  		return -1;
>  	return igt_debugfs_open("i915_forcewake_user", O_WRONLY);
>  }
> -static unsigned int clflush_size;
>  
>  #if defined(__x86_64__) || defined(__i386__)
> +static unsigned int clflush_size;
> +
>  int igt_setup_clflush(void)
>  {
>  	FILE *file;
> -- 
> 2.7.4
>
diff mbox

Patch

diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index a3d6a73..8a53775 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -383,9 +383,10 @@  int igt_open_forcewake_handle(void)
 		return -1;
 	return igt_debugfs_open("i915_forcewake_user", O_WRONLY);
 }
-static unsigned int clflush_size;
 
 #if defined(__x86_64__) || defined(__i386__)
+static unsigned int clflush_size;
+
 int igt_setup_clflush(void)
 {
 	FILE *file;