summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Wood <thomas.wood@intel.com>2015-11-02 10:18:27 +0000
committerThomas Wood <thomas.wood@intel.com>2015-11-11 14:20:55 +0000
commit2643793255084362e02bb1ca2ab5031de2d5dc59 (patch)
tree3f59d22bf795c72ecd5d958ba3e89ba59bae1365
parent52a393a3116f91157bc62d735db297d027d8724b (diff)
Fix comparison of unsigned integers
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
-rw-r--r--benchmarks/gem_exec_reloc.c2
-rw-r--r--overlay/gem-interrupts.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/benchmarks/gem_exec_reloc.c b/benchmarks/gem_exec_reloc.c
index 5be482a7..2ef6df57 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 48a36b85..0150a1d0 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;