diff options
author | Fengguang Wu <wufengguang@huawei.com> | 2020-03-05 14:00:49 +0800 |
---|---|---|
committer | Fengguang Wu <wufengguang@huawei.com> | 2020-03-05 14:01:35 +0800 |
commit | 2ad0bfa97c0396fa53933dfbf734a350d1e4347f (patch) | |
tree | 2e71c633da04d18f06b285bb0b7e2cf48f14a83d | |
parent | 0b057c87ae336580df8b80e1ecde829b83ec84b3 (diff) | |
download | vm-scalability-2ad0bfa97c0396fa53933dfbf734a350d1e4347f.tar.gz |
usemem: minor cleanups
Change pagesize to "unsigned long" since it's used
in comparison with other unsigned long variables.
Signed-off-by: Fengguang Wu <wufengguang@huawei.com>
-rw-r--r-- | usemem.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -66,7 +66,7 @@ #endif char *ourname; -int pagesize; +unsigned long pagesize; unsigned long done_bytes = 0; unsigned long opt_bytes = 0; unsigned long unit = 0; @@ -193,7 +193,7 @@ static const struct option opts[] = { { "delay" , 1, NULL, 'e' }, { "hugetlb" , 0, NULL, 'U' }, { "read-again" , 0, NULL, 'Z' }, - { "punch-holes", 0, NULL, 0 }, + { "punch-holes" , 0, NULL, 0 }, { "help" , 0, NULL, 'h' }, { NULL , 0, NULL, 0 } }; @@ -666,7 +666,7 @@ static void do_punch_holes(void *addr, unsigned long len) if (madvise(addr + offset, pagesize, MADV_DONTNEED) != 0) { fprintf(stderr, - "madvise failed with error %s\n", + "madvise MADV_DONTNEED failed: %s\n", strerror(errno)); exit(1); } @@ -943,8 +943,7 @@ int main(int argc, char *argv[]) { switch (c) { case 0: - if (strcmp(opts[opt_index].name, - "punch-holes") == 0) { + if (strcmp(opts[opt_index].name, "punch-holes") == 0) { opt_punch_holes = 1; } else usage(1); |