Author: stepan Date: 2007-05-23 20:24:58 +0200 (Wed, 23 May 2007) New Revision: 2690
Modified: trunk/LinuxBIOSv2/util/flashrom/82802ab.c trunk/LinuxBIOSv2/util/flashrom/flashrom.c trunk/LinuxBIOSv2/util/flashrom/lbtable.c trunk/LinuxBIOSv2/util/flashrom/sharplhf00l04.c trunk/LinuxBIOSv2/util/flashrom/sst49lfxxxc.c trunk/LinuxBIOSv2/util/flashrom/sst_fwhub.c Log: Unify mmap error messages in flashrom (trivial)
Signed-off-by: Stefan Reinauer stepan@coresystems.de Acked-by: Stefan Reinauer stepan@coresystems.de
Modified: trunk/LinuxBIOSv2/util/flashrom/82802ab.c =================================================================== --- trunk/LinuxBIOSv2/util/flashrom/82802ab.c 2007-05-23 17:20:56 UTC (rev 2689) +++ trunk/LinuxBIOSv2/util/flashrom/82802ab.c 2007-05-23 18:24:58 UTC (rev 2690) @@ -83,7 +83,7 @@ fd_mem, (off_t) (0 - 0x400000 - size)); if (registers == MAP_FAILED) { // it's this part but we can't map it ... - perror("Error MMAP memory using " MEM_DEV); + perror("Can't mmap memory using " MEM_DEV); exit(1); }
Modified: trunk/LinuxBIOSv2/util/flashrom/flashrom.c =================================================================== --- trunk/LinuxBIOSv2/util/flashrom/flashrom.c 2007-05-23 17:20:56 UTC (rev 2689) +++ trunk/LinuxBIOSv2/util/flashrom/flashrom.c 2007-05-23 18:24:58 UTC (rev 2690) @@ -116,15 +116,16 @@
#ifdef TS5300 // FIXME: Wrong place for this decision + // FIXME: This should be autodetected. It is trivial. flash_baseaddr = 0x9400000; #else flash_baseaddr = (0xffffffff - size + 1); #endif
/* If getpagesize() > size -> - * `Error MMAP /dev/mem: Invalid argument' + * "Can't mmap memory using /dev/mem: Invalid argument" * This should never happen as we don't support any flash chips - * smaller than 4k or 8k yet. + * smaller than 4k or 8k (yet). */
if (getpagesize() > size) { @@ -136,7 +137,7 @@ bios = mmap(0, size, PROT_WRITE | PROT_READ, MAP_SHARED, fd_mem, (off_t) flash_baseaddr); if (bios == MAP_FAILED) { - perror("Error: Can't mmap " MEM_DEV "."); + perror("Can't mmap memory using " MEM_DEV); exit(1); } flash->virtual_memory = bios;
Modified: trunk/LinuxBIOSv2/util/flashrom/lbtable.c =================================================================== --- trunk/LinuxBIOSv2/util/flashrom/lbtable.c 2007-05-23 17:20:56 UTC (rev 2689) +++ trunk/LinuxBIOSv2/util/flashrom/lbtable.c 2007-05-23 18:24:58 UTC (rev 2690) @@ -161,9 +161,7 @@ low_1MB = mmap(0, 1024 * 1024, PROT_READ, MAP_SHARED, fd_mem, 0x00000000); if (low_1MB == MAP_FAILED) { - fprintf(stderr, - "Can not mmap " MEM_DEV " at %08lx errno(%d):%s\n", - 0x00000000UL, errno, strerror(errno)); + perror("Can't mmap memory using " MEM_DEV); exit(-2); } lb_table = 0;
Modified: trunk/LinuxBIOSv2/util/flashrom/sharplhf00l04.c =================================================================== --- trunk/LinuxBIOSv2/util/flashrom/sharplhf00l04.c 2007-05-23 17:20:56 UTC (rev 2689) +++ trunk/LinuxBIOSv2/util/flashrom/sharplhf00l04.c 2007-05-23 18:24:58 UTC (rev 2690) @@ -82,7 +82,7 @@ fd_mem, (off_t) (0 - 0x400000 - size)); if (registers == MAP_FAILED) { // it's this part but we can't map it ... - perror("Error MMAP /dev/mem"); + perror("Can't mmap memory using " MEM_DEV); exit(1); }
Modified: trunk/LinuxBIOSv2/util/flashrom/sst49lfxxxc.c =================================================================== --- trunk/LinuxBIOSv2/util/flashrom/sst49lfxxxc.c 2007-05-23 17:20:56 UTC (rev 2689) +++ trunk/LinuxBIOSv2/util/flashrom/sst49lfxxxc.c 2007-05-23 18:24:58 UTC (rev 2690) @@ -154,7 +154,7 @@ fd_mem, (off_t) (0xFFFFFFFF - 0x400000 - size + 1)); if (registers == MAP_FAILED) { // it's this part but we can't map it ... - perror("Error MMAP /dev/mem"); + perror("Can't mmap memory using " MEM_DEV); exit(1); } flash->virtual_registers = registers;
Modified: trunk/LinuxBIOSv2/util/flashrom/sst_fwhub.c =================================================================== --- trunk/LinuxBIOSv2/util/flashrom/sst_fwhub.c 2007-05-23 17:20:56 UTC (rev 2689) +++ trunk/LinuxBIOSv2/util/flashrom/sst_fwhub.c 2007-05-23 18:24:58 UTC (rev 2690) @@ -56,7 +56,7 @@ fd_mem, (off_t) (0xFFFFFFFF - 0x400000 - size + 1)); if (registers == MAP_FAILED) { // it's this part but we can't map it ... - perror("Error MMAP /dev/mem"); + perror("Can't mmap memory using " MEM_DEV); exit(1); }