diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2015-03-03 13:14:56 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-03-06 07:42:22 +0100 |
commit | 8d9a8349cc01398b52ccd4285c3640e89f1d3001 (patch) | |
tree | 2ef9dc8720be107c065b86a71f6233ac8c612b25 /arch/sandbox/os | |
parent | 2f56f4d0507a8e7546d77d3d890a6cbf1e71ed61 (diff) | |
download | barebox-8d9a8349cc01398b52ccd4285c3640e89f1d3001.tar.gz barebox-8d9a8349cc01398b52ccd4285c3640e89f1d3001.tar.xz |
sandbox: hostfile: is always mmpad'ed
...so remove conditional code.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/sandbox/os')
-rw-r--r-- | arch/sandbox/os/common.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c index e2023165d5..3fa0370dfb 100644 --- a/arch/sandbox/os/common.c +++ b/arch/sandbox/os/common.c @@ -209,7 +209,7 @@ extern void mem_malloc_init(void *start, void *end); static int add_image(char *str, char *devname) { char *filename; - int readonly = 0, map = 1; + int readonly = 0; struct stat s; char *opt; int fd, ret; @@ -222,8 +222,6 @@ static int add_image(char *str, char *devname) while ((opt = strtok(NULL, ","))) { if (!strcmp(opt, "ro")) readonly = 1; - if (!strcmp(opt, "map")) - map = 1; } printf("add file %s(%s)\n", filename, readonly ? "ro" : ""); @@ -245,13 +243,11 @@ static int add_image(char *str, char *devname) hf->size = s.st_size; hf->devname = strdup(devname); - if (map) { - hf->base = (unsigned long)mmap(NULL, hf->size, - PROT_READ | (readonly ? 0 : PROT_WRITE), - MAP_SHARED, fd, 0); - if ((void *)hf->base == MAP_FAILED) - printf("warning: mmapping %s failed\n", filename); - } + hf->base = (unsigned long)mmap(NULL, hf->size, + PROT_READ | (readonly ? 0 : PROT_WRITE), + MAP_SHARED, fd, 0); + if ((void *)hf->base == MAP_FAILED) + printf("warning: mmapping %s failed\n", filename); ret = barebox_register_filedev(hf); if (ret) |