summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2012-08-30 14:03:54 -0700
committerBen Widawsky <ben@bwidawsk.net>2012-08-30 14:19:10 -0700
commit54ed938d393970584a9b2a8b0783b0c0901255db (patch)
tree558706eb1f75f6bb79d02c4703e57f089012fbb2 /tests
parentac23daaa51c88eba3e120afeaff9e491a2d61168 (diff)
clang: Fix warnings found through clang.
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_bad_length.c4
-rw-r--r--tests/gem_tiled_swapping.c12
-rw-r--r--tests/testdisplay.c2
3 files changed, 11 insertions, 7 deletions
diff --git a/tests/gem_bad_length.c b/tests/gem_bad_length.c
index 41f44d7f..0f2268f2 100644
--- a/tests/gem_bad_length.c
+++ b/tests/gem_bad_length.c
@@ -64,10 +64,12 @@ static uint32_t do_gem_create(int fd, int size, int *retval)
return create.handle;
}
+#if 0
static int gem_exec(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
{
return drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf);
}
+#endif
static void create0(int fd)
{
@@ -77,6 +79,7 @@ static void create0(int fd)
assert(retval == EINVAL);
}
+#if 0
static void exec0(int fd)
{
struct drm_i915_gem_execbuffer2 execbuf;
@@ -115,6 +118,7 @@ static void exec0(int fd)
gem_close(fd, exec[0].handle);
}
+#endif
int main(int argc, char **argv)
{
diff --git a/tests/gem_tiled_swapping.c b/tests/gem_tiled_swapping.c
index d1484f0e..c04a3bca 100644
--- a/tests/gem_tiled_swapping.c
+++ b/tests/gem_tiled_swapping.c
@@ -62,7 +62,7 @@
#define WIDTH 512
#define HEIGHT 512
-static uint32_t linear[WIDTH * HEIGHT];
+#define LINEAR_DWORDS (4 * WIDTH * HEIGHT)
static uint32_t current_tiling_mode;
#define PAGE_SIZE 4096
@@ -74,14 +74,14 @@ create_bo_and_fill(int fd)
uint32_t *data;
int i;
- handle = gem_create(fd, sizeof(linear));
+ handle = gem_create(fd, LINEAR_DWORDS);
gem_set_tiling(fd, handle, current_tiling_mode, WIDTH * sizeof(uint32_t));
/* Fill the BO with dwords starting at start_val */
- data = gem_mmap(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
+ data = gem_mmap(fd, handle, LINEAR_DWORDS, PROT_READ | PROT_WRITE);
for (i = 0; i < WIDTH*HEIGHT; i++)
data[i] = i;
- munmap(data, sizeof(linear));
+ munmap(data, LINEAR_DWORDS);
return handle;
}
@@ -129,14 +129,14 @@ main(int argc, char **argv)
for (i = 0; i < count/2; i++) {
/* Check the target bo's contents. */
data = gem_mmap(fd, bo_handles[idx_arr[i]],
- sizeof(linear), PROT_READ | PROT_WRITE);
+ LINEAR_DWORDS, PROT_READ | PROT_WRITE);
for (j = 0; j < WIDTH*HEIGHT; j++)
if (data[j] != j) {
fprintf(stderr, "mismatch at %i: %i\n",
j, data[j]);
exit(1);
}
- munmap(data, sizeof(linear));
+ munmap(data, LINEAR_DWORDS);
}
close(fd);
diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index 14d7da39..c52bb2f8 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -598,7 +598,7 @@ int update_display(void)
static char optstr[] = "hiaf:s:d:p:mrt";
-static void usage(char *name)
+static void __attribute__((noreturn)) usage(char *name)
{
fprintf(stderr, "usage: %s [-hiasdpmtf]\n", name);
fprintf(stderr, "\t-i\tdump info\n");