<p>Werner Zeh has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/27116">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">cbfstool: Use endian.h and functions from commonlib<br><br>The endian conversion function be32toh() is defined in<br>src/include/endian.h, however this file is not used for cbfstool<br>compilation. Currently the one provided by the host is used and if the<br>host does not provide this endian.h file, the build will fail.<br>However, we do have endian conversion functions in commonlib/endian.h<br>which is available for cbfstool compilation.<br><br>Switch from be32toh() to read_be32() in order to avoid relying on a<br>host provided include file.<br>We use functions from commonlib/endian.h already in cbfstool.<br><br>Change-Id: I106274cf9c69e1849f848920d96a61188f895b36<br>Signed-off-by: Werner Zeh <werner.zeh@siemens.com><br>---<br>M util/cbfstool/cbfs-mkpayload.c<br>1 file changed, 2 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/16/27116/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/util/cbfstool/cbfs-mkpayload.c b/util/cbfstool/cbfs-mkpayload.c</span><br><span>index 6dc1634..e26c530 100644</span><br><span>--- a/util/cbfstool/cbfs-mkpayload.c</span><br><span>+++ b/util/cbfstool/cbfs-mkpayload.c</span><br><span>@@ -18,6 +18,7 @@</span><br><span> #include <stdio.h></span><br><span> #include <stdlib.h></span><br><span> #include <string.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <commonlib/endian.h></span><br><span> </span><br><span> #include "elfparsing.h"</span><br><span> #include "common.h"</span><br><span>@@ -426,7 +427,7 @@</span><br><span>      DEBUG("start: parse_fit_to_payload\n");</span><br><span> </span><br><span>        fdt_h = buffer_get(input);</span><br><span style="color: hsl(0, 100%, 40%);">-      if (be32toh(fdt_h->magic) != FDT_HEADER_MAGIC) {</span><br><span style="color: hsl(120, 100%, 40%);">+   if (read_be32(&fdt_h->magic) != FDT_HEADER_MAGIC) {</span><br><span>           INFO("Not a FIT payload.\n");</span><br><span>              return -1;</span><br><span>   }</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/27116">change 27116</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/27116"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I106274cf9c69e1849f848920d96a61188f895b36 </div>
<div style="display:none"> Gerrit-Change-Number: 27116 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Werner Zeh <werner.zeh@siemens.com> </div>