diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2019-01-12 00:24:51 -0800 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-01-16 08:33:34 +0100 |
commit | 246216c24eb60d2742aec18fa875c40a905ed223 (patch) | |
tree | e51c56d9df1254b565720b2214b6697716d5033a /commands | |
parent | 31551c89701c42f63d3f4352ed84e7842d0ba9fe (diff) | |
download | barebox-246216c24eb60d2742aec18fa875c40a905ed223.tar.gz barebox-246216c24eb60d2742aec18fa875c40a905ed223.tar.xz |
treewide: Introduce MAP_FAILED and replace ad-hoc constants with it
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/go.c | 2 | ||||
-rw-r--r-- | commands/md.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/commands/go.c b/commands/go.c index fb319b320c..ecc2ceb6e4 100644 --- a/commands/go.c +++ b/commands/go.c @@ -45,7 +45,7 @@ static int do_go(int argc, char *argv[]) } addr = memmap(fd, PROT_READ); - if (addr == (void *)-1) { + if (addr == MAP_FAILED) { perror("memmap"); goto out; } diff --git a/commands/md.c b/commands/md.c index 3e83c723a3..a495fc8b41 100644 --- a/commands/md.c +++ b/commands/md.c @@ -68,7 +68,7 @@ static int do_mem_md(int argc, char *argv[]) return 1; map = memmap(fd, PROT_READ); - if (map != (void *)-1) { + if (map != MAP_FAILED) { ret = memory_display(map + start, start, size, mode >> O_RWSIZE_SHIFT, swab); goto out; |