Skip to content
Snippets Groups Projects
Commit 6c328f29 authored by Simon Glass's avatar Simon Glass
Browse files

patman: Fix up tests to pass with newest checkpatch


The checkpatch tool was updated but the patman tests were not. Fix this.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
parent 2f52018c
No related branches found
No related tags found
No related merge requests found
...@@ -88,8 +88,7 @@ Signed-off-by: Simon Glass <sjg@chromium.org> ...@@ -88,8 +88,7 @@ Signed-off-by: Simon Glass <sjg@chromium.org>
os.remove(expname) os.remove(expname)
def GetData(self, data_type): def GetData(self, data_type):
data=''' data='''From 4924887af52713cabea78420eff03badea8f0035 Mon Sep 17 00:00:00 2001
From 4924887af52713cabea78420eff03badea8f0035 Mon Sep 17 00:00:00 2001
From: Simon Glass <sjg@chromium.org> From: Simon Glass <sjg@chromium.org>
Date: Thu, 7 Apr 2011 10:14:41 -0700 Date: Thu, 7 Apr 2011 10:14:41 -0700
Subject: [PATCH 1/4] Add microsecond boot time measurement Subject: [PATCH 1/4] Add microsecond boot time measurement
...@@ -101,6 +100,7 @@ an available microsecond counter. ...@@ -101,6 +100,7 @@ an available microsecond counter.
%s %s
--- ---
README | 11 ++++++++ README | 11 ++++++++
MAINTAINERS | 3 ++
common/bootstage.c | 50 ++++++++++++++++++++++++++++++++++++ common/bootstage.c | 50 ++++++++++++++++++++++++++++++++++++
include/bootstage.h | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++ include/bootstage.h | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++
include/common.h | 8 ++++++ include/common.h | 8 ++++++
...@@ -130,19 +130,31 @@ index 6f3748d..f9e4e65 100644 ...@@ -130,19 +130,31 @@ index 6f3748d..f9e4e65 100644
- Standalone program support: - Standalone program support:
CONFIG_STANDALONE_LOAD_ADDR CONFIG_STANDALONE_LOAD_ADDR
diff --git a/MAINTAINERS b/MAINTAINERS
index b167b028ec..beb7dc634f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -474,3 +474,8 @@ S: Maintained
T: git git://git.denx.de/u-boot.git
F: *
F: */
+
+BOOTSTAGE
+M: Simon Glass <sjg@chromium.org>
+L: u-boot@lists.denx.de
+F: common/bootstage.c
diff --git a/common/bootstage.c b/common/bootstage.c diff --git a/common/bootstage.c b/common/bootstage.c
new file mode 100644 new file mode 100644
index 0000000..2234c87 index 0000000..2234c87
--- /dev/null --- /dev/null
+++ b/common/bootstage.c +++ b/common/bootstage.c
@@ -0,0 +1,39 @@ @@ -0,0 +1,37 @@
+/* +/*
+ * Copyright (c) 2011, Google Inc. All rights reserved. + * Copyright (c) 2011, Google Inc. All rights reserved.
+ * + *
+ * SPDX-License-Identifier: GPL-2.0+ + * SPDX-License-Identifier: GPL-2.0+
+ */ + */
+ +
+
+/* +/*
+ * This module records the progress of boot and arbitrary commands, and + * This module records the progress of boot and arbitrary commands, and
+ * permits accurate timestamping of each. The records can optionally be + * permits accurate timestamping of each. The records can optionally be
...@@ -151,26 +163,25 @@ index 0000000..2234c87 ...@@ -151,26 +163,25 @@ index 0000000..2234c87
+ +
+#include <common.h> +#include <common.h>
+ +
+
+struct bootstage_record { +struct bootstage_record {
+ uint32_t time_us; + u32 time_us;
+ const char *name; + const char *name;
+}; +};
+ +
+static struct bootstage_record record[BOOTSTAGE_COUNT]; +static struct bootstage_record record[BOOTSTAGE_COUNT];
+ +
+uint32_t bootstage_mark(enum bootstage_id id, const char *name) +u32 bootstage_mark(enum bootstage_id id, const char *name)
+{ +{
+ struct bootstage_record *rec = &record[id]; + struct bootstage_record *rec = &record[id];
+ +
+ /* Only record the first event for each */ + /* Only record the first event for each */
+%sif (!rec->name) { +%sif (!rec->name) {
+ rec->time_us = (uint32_t)timer_get_us(); + rec->time_us = (u32)timer_get_us();
+ rec->name = name; + rec->name = name;
+ } + }
+ if (!rec->name && + if (!rec->name &&
+ %ssomething_else) { + %ssomething_else) {
+ rec->time_us = (uint32_t)timer_get_us(); + rec->time_us = (u32)timer_get_us();
+ rec->name = name; + rec->name = name;
+ } + }
+%sreturn rec->time_us; +%sreturn rec->time_us;
...@@ -210,7 +221,7 @@ index 0000000..2234c87 ...@@ -210,7 +221,7 @@ index 0000000..2234c87
self.assertEqual(result.errors, 0) self.assertEqual(result.errors, 0)
self.assertEqual(result.warnings, 0) self.assertEqual(result.warnings, 0)
self.assertEqual(result.checks, 0) self.assertEqual(result.checks, 0)
self.assertEqual(result.lines, 56) self.assertEqual(result.lines, 62)
os.remove(inf) os.remove(inf)
def testNoSignoff(self): def testNoSignoff(self):
...@@ -221,18 +232,18 @@ index 0000000..2234c87 ...@@ -221,18 +232,18 @@ index 0000000..2234c87
self.assertEqual(result.errors, 1) self.assertEqual(result.errors, 1)
self.assertEqual(result.warnings, 0) self.assertEqual(result.warnings, 0)
self.assertEqual(result.checks, 0) self.assertEqual(result.checks, 0)
self.assertEqual(result.lines, 56) self.assertEqual(result.lines, 62)
os.remove(inf) os.remove(inf)
def testSpaces(self): def testSpaces(self):
inf = self.SetupData('spaces') inf = self.SetupData('spaces')
result = checkpatch.CheckPatch(inf) result = checkpatch.CheckPatch(inf)
self.assertEqual(result.ok, False) self.assertEqual(result.ok, False)
self.assertEqual(len(result.problems), 2) self.assertEqual(len(result.problems), 3)
self.assertEqual(result.errors, 0) self.assertEqual(result.errors, 0)
self.assertEqual(result.warnings, 2) self.assertEqual(result.warnings, 3)
self.assertEqual(result.checks, 0) self.assertEqual(result.checks, 0)
self.assertEqual(result.lines, 56) self.assertEqual(result.lines, 62)
os.remove(inf) os.remove(inf)
def testIndent(self): def testIndent(self):
...@@ -243,7 +254,7 @@ index 0000000..2234c87 ...@@ -243,7 +254,7 @@ index 0000000..2234c87
self.assertEqual(result.errors, 0) self.assertEqual(result.errors, 0)
self.assertEqual(result.warnings, 0) self.assertEqual(result.warnings, 0)
self.assertEqual(result.checks, 1) self.assertEqual(result.checks, 1)
self.assertEqual(result.lines, 56) self.assertEqual(result.lines, 62)
os.remove(inf) os.remove(inf)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment