diff options
author | Karel Zak | 2011-08-01 13:17:54 +0200 |
---|---|---|
committer | Karel Zak | 2011-08-01 13:17:54 +0200 |
commit | cee12fc60cd7f9fcff0f7447f3018f6eb0b125d1 (patch) | |
tree | 2588d004a819f8efac5ccbe2fa6c8fc5d6f18867 /schedutils | |
parent | setarch: fix compiler warnings [-Wsign-compare] (diff) | |
download | kernel-qcow2-util-linux-cee12fc60cd7f9fcff0f7447f3018f6eb0b125d1.tar.gz kernel-qcow2-util-linux-cee12fc60cd7f9fcff0f7447f3018f6eb0b125d1.tar.xz kernel-qcow2-util-linux-cee12fc60cd7f9fcff0f7447f3018f6eb0b125d1.zip |
ionice: fix compiler warnings [-Wsign-compare]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'schedutils')
-rw-r--r-- | schedutils/ionice.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/schedutils/ionice.c b/schedutils/ionice.c index 75f372e07..18529753f 100644 --- a/schedutils/ionice.c +++ b/schedutils/ionice.c @@ -59,7 +59,7 @@ const char *to_prio[] = { static int parse_ioclass(const char *str) { - int i; + size_t i; for (i = 0; i < ARRAY_SIZE(to_prio); i++) if (!strcasecmp(str, to_prio[i])) @@ -77,7 +77,7 @@ static void ioprio_print(int pid) int ioclass = IOPRIO_PRIO_CLASS(ioprio); const char *name = _("unknown"); - if (ioclass < ARRAY_SIZE(to_prio)) + if (ioclass > 0 && (size_t) ioclass < ARRAY_SIZE(to_prio)) name = to_prio[ioclass]; if (ioclass != IOPRIO_CLASS_IDLE) |