summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobbie Zhang <robbie.zhang@intel.com>2017-01-09 15:28:24 -0800
committerMartin Roth <martinroth@google.com>2017-01-11 17:15:42 +0100
commitfeb4ef6d92bdbcd12b2cd97b6446fb64b76cfef4 (patch)
treeea997fbb8f42cd04ae90458babc1c6c92e73617b
parent88a2e3b3bf7b622cd3bef941a3e3f71337644a39 (diff)
downloadcoreboot-feb4ef6d92bdbcd12b2cd97b6446fb64b76cfef4.tar.xz
chromeos: fix build issues within sar.c
Build issues were somehow overlooked in commit ed840023a84915ece4bc63edffef979926107d55: 1. hexstrtobin is not defined (needs the lib.h); 2. coreboot default compiler doesn't like variable initialization within for loop. BUG=chrome-os-partner:60821 TEST=Build and boot lars and reef Change-Id: Ie52c1f93eee7d739b8aaf59604875f179dff60d0 Signed-off-by: Robbie Zhang <robbie.zhang@intel.com> Reviewed-on: https://review.coreboot.org/18076 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--src/vendorcode/google/chromeos/sar.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vendorcode/google/chromeos/sar.c b/src/vendorcode/google/chromeos/sar.c
index 2b61e223d5..954492b822 100644
--- a/src/vendorcode/google/chromeos/sar.c
+++ b/src/vendorcode/google/chromeos/sar.c
@@ -13,6 +13,7 @@
* GNU General Public License for more details.
*/
#include <console/console.h>
+#include <lib.h>
#include <types.h>
#include <string.h>
#include <sar.h>
@@ -31,6 +32,7 @@ int get_wifi_sar_limits(struct wifi_sar_limits *sar_limits)
sizeof(uint8_t)) * 2 + 1;
char wifi_sar_limit_str[buffer_size];
uint8_t bin_buffer[sizeof(struct wifi_sar_limits)];
+ int i;
/* Try to read the SAR limit entry from VPD */
if (!cros_vpd_gets(wifi_sar_limit_key, wifi_sar_limit_str,
@@ -52,7 +54,7 @@ int get_wifi_sar_limits(struct wifi_sar_limits *sar_limits)
}
/* Fill the sar_limits structure with the decoded data */
- for (int i = 0; i < NUM_SAR_LIMITS; i++)
+ for (i = 0; i < NUM_SAR_LIMITS; i++)
memcpy(sar_limits->sar_limit[i],
&bin_buffer[BYTES_PER_SAR_LIMIT * i],
BYTES_PER_SAR_LIMIT);