[coreboot-gerrit] Change in coreboot[master]: intelmetool: Use correct type for pointer

Patrick Georgi (Code Review) gerrit at coreboot.org
Sat May 6 07:54:49 CEST 2017


Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/19567 )

Change subject: intelmetool: Use correct type for pointer
......................................................................


intelmetool: Use correct type for pointer

Use `uintptr_t` instead of `uint32_t`, fixing the error below on 64-bit
systems, where pointers are 64-bit wide.

```
cc -O0 -g -Wall -W -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-sign-compare -Wno-unused-function   -c -o intelmetool.o intelmetool.c
intelmetool.c: In function ‘dump_me_memory’:
intelmetool.c:85:45: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  dump = map_physical_exact((off_t)me_clone, (void *)me_clone, 0x2000000);
                                             ^
```

BUG=https://ticket.coreboot.org/issues/111
Change-Id: Id8d778e97090668ad9308a82b44c6b2b599fd6c3
Signed-off-by: Paul Menzel <pmenzel at molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/19567
Tested-by: build bot (Jenkins) <no-reply at coreboot.org>
Reviewed-by: Aaron Durbin <adurbin at chromium.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki at gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude at gmail.com>
Reviewed-by: Paul Wise (Debian) <pabs at debian.org>
---
M util/intelmetool/intelmetool.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Aaron Durbin: Looks good to me, approved
  Philippe Mathieu-Daudé: Looks good to me, but someone else must approve
  Philipp Deppenwiese: Looks good to me, approved
  Paul Wise (Debian): Looks good to me, but someone else must approve
  build bot (Jenkins): Verified



diff --git a/util/intelmetool/intelmetool.c b/util/intelmetool/intelmetool.c
index 11c2120..b918c3e 100644
--- a/util/intelmetool/intelmetool.c
+++ b/util/intelmetool/intelmetool.c
@@ -79,7 +79,7 @@
  * so we avoid cloning to this part.
  */
 static void dump_me_memory() {
-	uint32_t me_clone = 0x60000000;
+	uintptr_t me_clone = 0x60000000;
 	uint8_t *dump;
 
 	dump = map_physical_exact((off_t)me_clone, (void *)me_clone, 0x2000000);

-- 
To view, visit https://review.coreboot.org/19567
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id8d778e97090668ad9308a82b44c6b2b599fd6c3
Gerrit-PatchSet: 2
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Paul Menzel <paulepanter at users.sourceforge.net>
Gerrit-Reviewer: Aaron Durbin <adurbin at chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h at gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi at google.com>
Gerrit-Reviewer: Paul Wise (Debian) <pabs at debian.org>
Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki at gmail.com>
Gerrit-Reviewer: Philippe Mathieu-Daudé <philippe.mathieu.daude at gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>



More information about the coreboot-gerrit mailing list