Add checkpatch.pl to presubmit tests.

Change-Id: I235ea140f5f54dc8b22f1c69dcff5e99a34ff602
diff --git a/src/api.c b/src/api.c
index 8ff3b60..7341bfc 100644
--- a/src/api.c
+++ b/src/api.c
@@ -274,7 +274,7 @@
 /**
  * Check that the mode indicates memory that is valid, owned and exclusive.
  */
-bool static api_mode_valid_owned_and_exclusive(int mode)
+static bool api_mode_valid_owned_and_exclusive(int mode)
 {
 	return (mode & (MM_MODE_INVALID | MM_MODE_UNOWNED | MM_MODE_SHARED)) ==
 	       0;
diff --git a/src/arch/aarch64/msr.h b/src/arch/aarch64/msr.h
index 3989342..b77461c 100644
--- a/src/arch/aarch64/msr.h
+++ b/src/arch/aarch64/msr.h
@@ -27,5 +27,9 @@
 		__v;                                            \
 	})
 
-#define write_msr(name, value) \
-	__asm__ volatile("msr " #name ", %x0" : : "rZ"((uintreg_t)(value)))
+#define write_msr(name, value)                                \
+	__extension__({                                       \
+		__asm__ volatile("msr " #name ", %x0"         \
+				 :                            \
+				 : "rZ"((uintreg_t)(value))); \
+	})
diff --git a/src/dlog.c b/src/dlog.c
index 322c054..1ce5566 100644
--- a/src/dlog.c
+++ b/src/dlog.c
@@ -53,9 +53,11 @@
 static size_t print_raw_string(const char *str)
 {
 	const char *c = str;
+
 	while (*c != '\0') {
 		arch_putchar(*c++);
 	}
+
 	return c - str;
 }
 
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) +
diff --git a/src/std.c b/src/std.c
index 036c563..45263c8 100644
--- a/src/std.c
+++ b/src/std.c
@@ -19,9 +19,11 @@
 void *memset(void *s, int c, size_t n)
 {
 	char *p = (char *)s;
+
 	while (n--) {
 		*p++ = c;
 	}
+
 	return s;
 }
 
@@ -31,9 +33,11 @@
 size_t strlen(const char *str)
 {
 	const char *p = str;
+
 	while (*p) {
 		p++;
 	}
+
 	return p - str;
 }
 
diff --git a/src/vm.c b/src/vm.c
index 4a14eae..40aa294 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -76,6 +76,7 @@
 void vm_start_vcpu(struct vm *vm, size_t index, ipaddr_t entry, uintreg_t arg)
 {
 	struct vcpu *vcpu = &vm->vcpus[index];
+
 	if (index < vm->vcpu_count) {
 		arch_regs_set_pc_arg(&vcpu->regs, entry, arg);
 		vcpu_on(vcpu);