diff options
Diffstat (limited to 'commands')
-rw-r--r-- | commands/digest.c | 3 | ||||
-rw-r--r-- | commands/go.c | 2 | ||||
-rw-r--r-- | commands/md.c | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/commands/digest.c b/commands/digest.c index 0edbbec32c..99b27dcc25 100644 --- a/commands/digest.c +++ b/commands/digest.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> +#include <linux/pagemap.h> #include <fs.h> #include <fcntl.h> #include <errno.h> @@ -35,7 +36,7 @@ int __do_digest(struct digest *d, unsigned char *sig, while (*argv) { char *filename = "/dev/mem"; - loff_t start = 0, size = ~0; + loff_t start = 0, size = MAX_LFS_FILESIZE; int show_area = 1; /* arguments are either file, file+area or area */ 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; |