[coreboot-gerrit] New patch to review for coreboot: 59e45c6 cbmem: map_memory: Use length modifier `l` for an argument with type off_t

Paul Menzel (paulepanter@users.sourceforge.net) gerrit at coreboot.org
Sat Apr 13 18:33:15 CEST 2013


Paul Menzel (paulepanter at users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3083

-gerrit

commit 59e45c630ab672cdf6f955aec9355b33de56f510
Author: Paul Menzel <paulepanter at users.sourceforge.net>
Date:   Sat Apr 13 18:25:56 2013 +0200

    cbmem: map_memory: Use length modifier `l` for an argument with type off_t
    
    cbmem currently fails to build due to `-Werror` and the following warning.
    
        $ make
        cc -O2 -Wall -Werror -iquote ../../src/include -iquote ../../src/src/arch/x86  -c -o cbmem.o cbmem.c
        cbmem.c: In function ‘map_memory’:
        cbmem.c:87:2: error: format ‘%zx’ expects argument of type ‘size_t’, but argument 2 has type ‘off_t’ [-Werror=format]
        […]
    
    Using the length modifier `l` instead of `z` for an argument with type off_t,
    so `%lx` instead of `%lz`, gets rid of this warning.
    
    Change-Id: I1360abbc47aa1662e1edfbe337cf7911695c532f
    Signed-off-by: Paul Menzel <paulepanter at users.sourceforge.net>
---
 util/cbmem/cbmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c
index f3f5add..d94c670 100644
--- a/util/cbmem/cbmem.c
+++ b/util/cbmem/cbmem.c
@@ -84,7 +84,7 @@ static void *map_memory(u64 physical)
 	/* Mapped memory must be aligned to page size */
 	p = physical & ~(page - 1);
 
-	debug("Mapping 1MB of physical memory at 0x%zx.\n", p);
+	debug("Mapping 1MB of physical memory at 0x%lx.\n", p);
 
 	v = mmap(NULL, MAP_BYTES, PROT_READ, MAP_SHARED, fd, p);
 



More information about the coreboot-gerrit mailing list