[PATCH 6/8] fix warn in gem_reg_read: 'read' shadows a global declaration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Imre Deak <imre.deak at intel.com>
---
 tests/gem_reg_read.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/tests/gem_reg_read.c b/tests/gem_reg_read.c
index 1d6db1f..692dd98 100644
--- a/tests/gem_reg_read.c
+++ b/tests/gem_reg_read.c
@@ -52,29 +52,29 @@ static void handle_bad(int ret, int lerrno, int expected, const char *desc)
 
 static uint64_t timer_query(int fd)
 {
-	struct local_drm_i915_reg_read read;
+	struct local_drm_i915_reg_read reg_read;
 	int ret;
 
-	read.offset = 0x2358;
-	ret = drmIoctl(fd, REG_READ_IOCTL, &read);
+	reg_read.offset = 0x2358;
+	ret = drmIoctl(fd, REG_READ_IOCTL, &reg_read);
 	if (ret) {
 		perror("positive test case failed: ");
 		exit(EXIT_FAILURE);
 	}
 
-	return read.val;
+	return reg_read.val;
 }
 
 int main(int argc, char *argv[])
 {
-	struct local_drm_i915_reg_read read;
+	struct local_drm_i915_reg_read reg_read;
 	int ret, fd;
 	uint64_t val;
 
 	fd = drm_open_any();
 
-	read.offset = 0x2358;
-	ret = drmIoctl(fd, REG_READ_IOCTL, &read);
+	reg_read.offset = 0x2358;
+	ret = drmIoctl(fd, REG_READ_IOCTL, &reg_read);
 	if (errno == EINVAL)
 		exit(77);
 	else if (ret)
@@ -88,8 +88,8 @@ int main(int argc, char *argv[])
 	}
 
 	/* bad reg */
-	read.offset = 0x12345678;
-	ret = drmIoctl(fd, REG_READ_IOCTL, &read);
+	reg_read.offset = 0x12345678;
+	ret = drmIoctl(fd, REG_READ_IOCTL, &reg_read);
 	handle_bad(ret, errno, EINVAL, "bad register");
 
 	close(fd);
-- 
1.7.9.5



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux