[PATCH i-g-t 6/8] Fix comparison of unsigned integers

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

 



Signed-off-by: Thomas Wood <thomas.wood@xxxxxxxxx>
---
 benchmarks/gem_exec_reloc.c | 2 --
 overlay/gem-interrupts.c    | 7 +++++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/benchmarks/gem_exec_reloc.c b/benchmarks/gem_exec_reloc.c
index 5be482a..2ef6df5 100644
--- a/benchmarks/gem_exec_reloc.c
+++ b/benchmarks/gem_exec_reloc.c
@@ -249,8 +249,6 @@ int main(int argc, char **argv)
 
 		case 'r':
 			num_relocs = atoi(optarg);
-			if (num_relocs < 0)
-				num_relocs = 0;
 			break;
 		}
 	}
diff --git a/overlay/gem-interrupts.c b/overlay/gem-interrupts.c
index 48a36b8..0150a1d 100644
--- a/overlay/gem-interrupts.c
+++ b/overlay/gem-interrupts.c
@@ -142,9 +142,12 @@ int gem_interrupts_update(struct gem_interrupts *irqs)
 		return irqs->error;
 
 	if (irqs->fd < 0) {
-		val = interrupts_read();
-		if (val < 0)
+		long long ret;
+		ret = interrupts_read();
+		if (ret < 0)
 			return irqs->error = ENODEV;
+		else
+			val = ret;
 	} else {
 		if (read(irqs->fd, &val, sizeof(val)) < 0)
 			return irqs->error = errno;
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




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