]> git.sur5r.net Git - u-boot/blobdiff - tools/patman/test.py
Merge git://git.denx.de/u-boot-dm
[u-boot] / tools / patman / test.py
index 8c39f66e73089b892311b9e5655e48831f5a7a10..e1b94bd1a7db44c1fff252e546596af251017941 100644 (file)
@@ -1,8 +1,8 @@
+# -*- coding: utf-8 -*-
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Copyright (c) 2011 The Chromium OS Authors.
 #
-# SPDX-License-Identifier:     GPL-2.0+
-#
 
 import os
 import tempfile
@@ -31,6 +31,10 @@ Subject: [PATCH (resend) 3/7] Tegra2: Add more clock support
 
 This adds functions to enable/disable clocks and reset to on-chip peripherals.
 
+cmd/pci.c:152:11: warning: format ‘%llx’ expects argument of type
+   ‘long long unsigned int’, but argument 3 has type
+   ‘u64 {aka long unsigned int}’ [-Wformat=]
+
 BUG=chromium-os:13875
 TEST=build U-Boot for Seaboard, boot
 
@@ -53,6 +57,10 @@ Subject: [PATCH (resend) 3/7] Tegra2: Add more clock support
 
 This adds functions to enable/disable clocks and reset to on-chip peripherals.
 
+cmd/pci.c:152:11: warning: format ‘%llx’ expects argument of type
+   ‘long long unsigned int’, but argument 3 has type
+   ‘u64 {aka long unsigned int}’ [-Wformat=]
+
 Signed-off-by: Simon Glass <sjg@chromium.org>
 ---
 
@@ -79,8 +87,7 @@ Signed-off-by: Simon Glass <sjg@chromium.org>
         os.remove(expname)
 
     def GetData(self, data_type):
-        data='''
-From 4924887af52713cabea78420eff03badea8f0035 Mon Sep 17 00:00:00 2001
+        data='''From 4924887af52713cabea78420eff03badea8f0035 Mon Sep 17 00:00:00 2001
 From: Simon Glass <sjg@chromium.org>
 Date: Thu, 7 Apr 2011 10:14:41 -0700
 Subject: [PATCH 1/4] Add microsecond boot time measurement
@@ -92,6 +99,7 @@ an available microsecond counter.
 %s
 ---
  README              |   11 ++++++++
+ MAINTAINERS         |    3 ++
  common/bootstage.c  |   50 ++++++++++++++++++++++++++++++++++++
  include/bootstage.h |   71 +++++++++++++++++++++++++++++++++++++++++++++++++++
  include/common.h    |    8 ++++++
@@ -121,19 +129,31 @@ index 6f3748d..f9e4e65 100644
  - Standalone program support:
                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
 new file mode 100644
 index 0000000..2234c87
 --- /dev/null
 +++ b/common/bootstage.c
-@@ -0,0 +1,39 @@
+@@ -0,0 +1,37 @@
++%s
 +/*
 + * Copyright (c) 2011, Google Inc. All rights reserved.
 + *
-+ * SPDX-License-Identifier:   GPL-2.0+
 + */
 +
-+
 +/*
 + * This module records the progress of boot and arbitrary commands, and
 + * permits accurate timestamping of each. The records can optionally be
@@ -142,26 +162,25 @@ index 0000000..2234c87
 +
 +#include <common.h>
 +
-+
 +struct bootstage_record {
-+      uint32_t time_us;
++      u32 time_us;
 +      const char *name;
 +};
 +
 +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];
 +
 +      /* Only record the first event for each */
 +%sif (!rec->name) {
-+              rec->time_us = (uint32_t)timer_get_us();
++              rec->time_us = (u32)timer_get_us();
 +              rec->name = name;
 +      }
 +      if (!rec->name &&
 +      %ssomething_else) {
-+              rec->time_us = (uint32_t)timer_get_us();
++              rec->time_us = (u32)timer_get_us();
 +              rec->name = name;
 +      }
 +%sreturn rec->time_us;
@@ -170,19 +189,22 @@ index 0000000..2234c87
 1.7.3.1
 '''
         signoff = 'Signed-off-by: Simon Glass <sjg@chromium.org>\n'
+        license = '// SPDX-License-Identifier: GPL-2.0+'
         tab = '        '
         indent = '    '
         if data_type == 'good':
             pass
         elif data_type == 'no-signoff':
             signoff = ''
+        elif data_type == 'no-license':
+            license = ''
         elif data_type == 'spaces':
             tab = '   '
         elif data_type == 'indent':
             indent = tab
         else:
             print('not implemented')
-        return data % (signoff, tab, indent, tab)
+        return data % (signoff, license, tab, indent, tab)
 
     def SetupData(self, data_type):
         inhandle, inname = tempfile.mkstemp()
@@ -201,7 +223,7 @@ index 0000000..2234c87
         self.assertEqual(result.errors, 0)
         self.assertEqual(result.warnings, 0)
         self.assertEqual(result.checks, 0)
-        self.assertEqual(result.lines, 56)
+        self.assertEqual(result.lines, 62)
         os.remove(inf)
 
     def testNoSignoff(self):
@@ -212,18 +234,29 @@ index 0000000..2234c87
         self.assertEqual(result.errors, 1)
         self.assertEqual(result.warnings, 0)
         self.assertEqual(result.checks, 0)
-        self.assertEqual(result.lines, 56)
+        self.assertEqual(result.lines, 62)
+        os.remove(inf)
+
+    def testNoLicense(self):
+        inf = self.SetupData('no-license')
+        result = checkpatch.CheckPatch(inf)
+        self.assertEqual(result.ok, False)
+        self.assertEqual(len(result.problems), 1)
+        self.assertEqual(result.errors, 0)
+        self.assertEqual(result.warnings, 1)
+        self.assertEqual(result.checks, 0)
+        self.assertEqual(result.lines, 62)
         os.remove(inf)
 
     def testSpaces(self):
         inf = self.SetupData('spaces')
         result = checkpatch.CheckPatch(inf)
         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.warnings, 2)
+        self.assertEqual(result.warnings, 3)
         self.assertEqual(result.checks, 0)
-        self.assertEqual(result.lines, 56)
+        self.assertEqual(result.lines, 62)
         os.remove(inf)
 
     def testIndent(self):
@@ -234,7 +267,7 @@ index 0000000..2234c87
         self.assertEqual(result.errors, 0)
         self.assertEqual(result.warnings, 0)
         self.assertEqual(result.checks, 1)
-        self.assertEqual(result.lines, 56)
+        self.assertEqual(result.lines, 62)
         os.remove(inf)