Add checkpatch.pl to presubmit tests.
Change-Id: I235ea140f5f54dc8b22f1c69dcff5e99a34ff602
diff --git a/src/fdt.c b/src/fdt.c
index cb7e524..697983e 100644
--- a/src/fdt.c
+++ b/src/fdt.c
@@ -72,6 +72,7 @@
static bool fdt_tokenizer_uint32(struct fdt_tokenizer *t, uint32_t *res)
{
const char *next = t->cur + sizeof(*res);
+
if (next > t->end) {
return false;
}
@@ -99,6 +100,7 @@
size_t size)
{
const char *next = t->cur + size;
+
if (next > t->end) {
return false;
}
@@ -113,6 +115,7 @@
static bool fdt_tokenizer_str(struct fdt_tokenizer *t, const char **res)
{
const char *p;
+
for (p = t->cur; p < t->end; p++) {
if (!*p) {
/* Found the end of the string. */
@@ -221,6 +224,7 @@
const char *name;
const char *buf;
uint32_t size;
+
while (fdt_next_property(t, &name, &buf, &size)) {
/* do nothing */
}
@@ -396,6 +400,7 @@
/* TODO: Clean this up. */
uint8_t *begin = (uint8_t *)hdr + be32toh(hdr->off_mem_rsvmap);
struct fdt_reserve_entry *e = (struct fdt_reserve_entry *)begin;
+
hdr->totalsize = htobe32(be32toh(hdr->totalsize) +
sizeof(struct fdt_reserve_entry));
hdr->off_dt_struct = htobe32(be32toh(hdr->off_dt_struct) +