<p>Bill XIE has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/21509">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ifdtool: merge region_filenames with region_name(s)<br><br>There is no reason to keep a separate region_filenames array,<br>so I merge it into region_name(s).<br><br>This commit is one separated from the original I6d05418c.<br><br>Change-Id: I38489c6d3b3c161e9b0281188e6cdd0b62e38335<br>Signed-off-by: Bill XIE <persmule@gmail.com><br>---<br>M util/ifdtool/ifdtool.c<br>M util/ifdtool/ifdtool.h<br>2 files changed, 11 insertions(+), 22 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/21509/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c<br>index e330494..03b28f4 100644<br>--- a/util/ifdtool/ifdtool.c<br>+++ b/util/ifdtool/ifdtool.c<br>@@ -33,15 +33,15 @@<br> static int platform = -1;<br> <br> static const struct region_name region_names[MAX_REGIONS] = {<br>-    { "Flash Descriptor", "fd" },<br>-    { "BIOS", "bios" },<br>-      { "Intel ME", "me" },<br>-    { "GbE", "gbe" },<br>-        { "Platform Data", "pd" },<br>-       { "Reserved", "res1" },<br>-  { "Reserved", "res2" },<br>-  { "Reserved", "res3" },<br>-  { "EC", "ec" },<br>+  { "Flash Descriptor", "fd", "flashregion_0_flashdescriptor.bin" },<br>+     { "BIOS", "bios", "flashregion_1_bios.bin" },<br>+  { "Intel ME", "me", "flashregion_2_intel_me.bin" },<br>+    { "GbE", "gbe", "flashregion_3_gbe.bin" },<br>+     { "Platform Data", "pd", "flashregion_4_platform_data.bin" },<br>+  { "Reserved", "res1", "flashregion_5_reserved.bin" },<br>+  { "Reserved", "res2", "flashregion_6_reserved.bin" },<br>+  { "Reserved", "res3", "flashregion_7_reserved.bin" },<br>+  { "EC", "ec", "flashregion_8_ec.bin" }<br> };<br> <br> static fdbar_t *find_fd(char *image, int size)<br>@@ -226,24 +226,12 @@<br> <br> static const char *region_filename(unsigned int region_type)<br> {<br>-   static const char * const region_filenames[MAX_REGIONS] = {<br>-          "flashregion_0_flashdescriptor.bin",<br>-               "flashregion_1_bios.bin",<br>-          "flashregion_2_intel_me.bin",<br>-              "flashregion_3_gbe.bin",<br>-           "flashregion_4_platform_data.bin",<br>-         "flashregion_5_reserved.bin",<br>-              "flashregion_6_reserved.bin",<br>-              "flashregion_7_reserved.bin",<br>-              "flashregion_8_ec.bin",<br>-    };<br>-<br>         if (region_type >= max_regions) {<br>          fprintf(stderr, "Invalid region type %d.\n", region_type);<br>          exit (EXIT_FAILURE);<br>  }<br> <br>- return region_filenames[region_type];<br>+        return region_names[region_type].filename;<br> }<br> <br> static void dump_region(unsigned int num, const frba_t *frba)<br>diff --git a/util/ifdtool/ifdtool.h b/util/ifdtool/ifdtool.h<br>index 1ebe629..f50f6be 100644<br>--- a/util/ifdtool/ifdtool.h<br>+++ b/util/ifdtool/ifdtool.h<br>@@ -142,4 +142,5 @@<br> struct region_name {<br>        const char *pretty;<br>   const char *terse;<br>+   const char *filename;<br> };<br></pre><p>To view, visit <a href="https://review.coreboot.org/21509">change 21509</a>. To unsubscribe, 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/21509"/><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: I38489c6d3b3c161e9b0281188e6cdd0b62e38335 </div>
<div style="display:none"> Gerrit-Change-Number: 21509 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Bill XIE <persmule@gmail.com> </div>