summaryrefslogtreecommitdiff
path: root/tools/intel_error_decode.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-01-09 23:06:41 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-01-09 23:38:28 +0100
commit391e6aa89ad21fa161632b41ff8e1f48352d0287 (patch)
tree287a20cf22b7671bca1e9eea83f55f948dfc19eb /tools/intel_error_decode.c
parent7ee9f16e5166a4b0dddb76ad5166410c388f603e (diff)
tools/intel_error_decode: fixup new warnings
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tools/intel_error_decode.c')
-rw-r--r--tools/intel_error_decode.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/tools/intel_error_decode.c b/tools/intel_error_decode.c
index a5c05d76..5fe2fd7d 100644
--- a/tools/intel_error_decode.c
+++ b/tools/intel_error_decode.c
@@ -285,7 +285,7 @@ read_data_file (FILE *file)
size_t line_size;
uint32_t offset, value;
uint32_t gtt_offset = 0, new_gtt_offset;
- char *buffer_type[2] = { "ringbuffer", "batchbuffer" };
+ const char *buffer_type[2] = { "ringbuffer", "batchbuffer" };
char *ring_name = NULL;
int is_batch = 1;
@@ -430,7 +430,7 @@ main (int argc, char *argv[])
const char *path;
char *filename;
struct stat st;
- int err;
+ int error;
if (argc > 2) {
fprintf (stderr,
@@ -451,11 +451,11 @@ main (int argc, char *argv[])
if (argc == 1) {
if (isatty(0)) {
path = "/debug/dri";
- err = stat (path, &st);
- if (err != 0) {
+ error = stat (path, &st);
+ if (error != 0) {
path = "/sys/kernel/debug/dri";
- err = stat (path, &st);
- if (err != 0) {
+ error = stat (path, &st);
+ if (error != 0) {
errx(1,
"Couldn't find i915 debugfs directory.\n\n"
"Is debugfs mounted? You might try mounting it with a command such as:\n\n"
@@ -468,8 +468,8 @@ main (int argc, char *argv[])
}
} else {
path = argv[1];
- err = stat (path, &st);
- if (err != 0) {
+ error = stat (path, &st);
+ if (error != 0) {
fprintf (stderr, "Error opening %s: %s\n",
path, strerror (errno));
exit (1);
@@ -495,11 +495,10 @@ main (int argc, char *argv[])
exit (1);
}
} else {
- filename = (char *) path;
- file = fopen(filename, "r");
+ file = fopen(path, "r");
if (!file) {
fprintf (stderr, "Failed to open %s: %s\n",
- filename, strerror (errno));
+ path, strerror (errno));
exit (1);
}
}