Martin Roth (martinroth(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18570
-gerrit
commit 687813fa37215a3831d6e9143e92c5cd3b00d7e7
Author: Martin Roth <martinroth(a)google.com>
Date: Sat Mar 4 19:28:37 2017 -0700
uti/lint/checkpatch: Fix __attribute__ struct errors for OPEN_BRACE
The __attribute__((weak)) lines on structs were being read as functions,
causing a warning that the brace should be on the next line.
Add a check to see if it's a struct with an attribute, and ignore it for
the OPEN_BRACE check if it is.
Change-Id: Ieb0c96027e8df842f60ca7c9de7aac941eed1dc2
Signed-off-by: Martin Roth <martinroth(a)google.com>
---
util/lint/checkpatch.pl | 1 +
1 file changed, 1 insertion(+)
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl
index 031aa34..9afa232 100755
--- a/util/lint/checkpatch.pl
+++ b/util/lint/checkpatch.pl
@@ -3736,6 +3736,7 @@ sub process {
# function brace can't be on same line, except for #defines of do while,
# or if closed on same line
if (($line=~/$Type\s*$Ident\(.*\).*\s*{/) and
+ ($line!~/struct.*__attribute__\(\(.*\)\)/) and
!($line=~/\#\s*define.*do\s\{/) and !($line=~/}/)) {
if (ERROR("OPEN_BRACE",
"open brace '{' following function declarations go on the next line\n" . $herecurr) &&
Martin Roth (martinroth(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18569
-gerrit
commit cd51cb1e5f9300a8da3e1955f8af39327c0eb8ef
Author: Martin Roth <martinroth(a)google.com>
Date: Sat Mar 4 18:51:16 2017 -0700
checkpatch.conf: Update rules
- Remove the "MISSING_SPACE" check which checks for breaks at a space in
a string concatenation. Most of the time this makes sense, but we
occasionally need to break where there isn't a space, so having a hard
rule doesn't always work.
- Don't check the vendorcode directory for compliance to coreboot's
code format rules.
Change-Id: Ic07677b19520b5d22363834c77f5dee7bba9e429
Signed-off-by: Martin Roth <martinroth(a)google.com>
---
.checkpatch.conf | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/.checkpatch.conf b/.checkpatch.conf
index f194ced..ad04d39 100644
--- a/.checkpatch.conf
+++ b/.checkpatch.conf
@@ -15,6 +15,7 @@
--ignore AVOID_EXTERNS
--ignore VOLATILE
--ignore CONFIG_DESCRIPTION
+--ignore MISSING_SPACE
# FILE_PATH_CHANGES seems to not be working correctly. It will
# choke on added / deleted files even if the MAINTAINERS file
@@ -24,3 +25,7 @@
# This one has a linux path hard coded, so it would choke on
# some commits unnecessarily.
--ignore EXECUTE_PERMISSIONS
+
+# Exclude the vendorcode directory
+--exclude src/vendorcode
+
Martin Roth (martinroth(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18568
-gerrit
commit 6f0c021c8448531514bdcb654862c9909c5ffd66
Author: Martin Roth <martinroth(a)google.com>
Date: Sat Mar 4 18:17:35 2017 -0700
uti/lint/checkpatch: add --exclude to ignore specific directories
checkpatch: add option for excluding directories
when importing code from external sources
Using --exclude <dir> we should be able to exclude a list of well
defined locations in the tree that carry sources from other projects
with other styles.
This comes from the 01org/zephyr project in github:
Original-Change-Id: I7d321e85eed6bc37d5c6879ae88e21d20028a433
Original-Signed-off-by: Anas Nashif <anas.nashif(a)intel.com>
Change-Id: Icc9e841e7d84026d6ab857ff90b0f093515ccaad
Signed-off-by: Martin Roth <martinroth(a)google.com>
---
util/lint/checkpatch.pl | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl
index 84574f1..031aa34 100755
--- a/util/lint/checkpatch.pl
+++ b/util/lint/checkpatch.pl
@@ -45,6 +45,7 @@ my %use_type = ();
my @use = ();
my %ignore_type = ();
my @ignore = ();
+my @exclude = ();
my $help = 0;
my $configuration_file = ".checkpatch.conf";
my $max_line_length = 80;
@@ -86,6 +87,7 @@ Options:
--list-types list the possible message types
--types TYPE(,TYPE2...) show only these comma separated message types
--ignore TYPE(,TYPE2...) ignore various comma separated message types
+ --exclude DIR(,DIR22...) exclude directories
--show-types show the specific message type in the output
--max-line-length=n set the maximum line length, if exceeded, warn
--min-conf-desc-length=n set the min description length, if shorter, warn
@@ -190,6 +192,7 @@ GetOptions(
'subjective!' => \$check,
'strict!' => \$check,
'ignore=s' => \@ignore,
+ 'exclude=s' => \@exclude,
'types=s' => \@use,
'show-types!' => \$show_types,
'list-types!' => \$list_types,
@@ -2277,6 +2280,16 @@ sub process {
$found_file = 1;
}
+ my $skipme = 0;
+ foreach (@exclude) {
+ if ($realfile =~ m@^(?:$_/)@) {
+ $skipme = 1;
+ }
+ }
+ if ($skipme) {
+ next;
+ }
+
#make up the handle for any error we report on this line
if ($showfile) {
$prefix = "$realfile:$realline: "
Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18520
-gerrit
commit 88565be48b55b58f115edb9985e5665296edb25a
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Tue Feb 28 20:23:37 2017 +0100
ec/lenovo/h8: Use older syntax for bit shift
Currently, when using `iasl` from Debian 8 (Jessie/stable), the build of
the Lenovo X60 fails with the error below.
```
Intel ACPI Component Architecture
ASL Optimizing Compiler version 20140926-32 [Oct 1 2014]
Copyright (c) 2000 - 2014 Intel Corporation
Compiler aborting due to parser-detected syntax error(s)
dsdt.aml 1698: Return (TBSW << 3)
Error 6126 - ^ Invalid character (0x3C), expecting ASL keyword or name
Store (DHKN, EMSK)
dsdt.aml 1698: Return (TBSW << 3)
Error 6126 - ^ Invalid character (0x3C), expecting ASL keyword or name
dsdt.aml 1698: Return (TBSW << 3)
Error 6126 - ^ syntax error, unexpected PARSEOP_INTEGER, expecting ')'
ASL Input: dsdt.aml - 2405 lines, 42862 bytes, 1000 keywords
Compilation complete. 3 Errors, 0 Warnings, 0 Remarks, 0 Optimizations
```
ASL 2.0 supports `<<`. For consistency, right now, coreboot still uses
the old syntax. So use `ShiftLeft` instead, which also fixes the build
issue with older ASL compilers.
Change-Id: Id7e309c31612387da3920cf7d846b358ac2bdc71
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
src/ec/lenovo/h8/acpi/ec.asl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ec/lenovo/h8/acpi/ec.asl b/src/ec/lenovo/h8/acpi/ec.asl
index b8350ad..ed62afe 100644
--- a/src/ec/lenovo/h8/acpi/ec.asl
+++ b/src/ec/lenovo/h8/acpi/ec.asl
@@ -363,7 +363,7 @@ Device(EC)
/* Report tablet mode switch state */
Method (MHKG, 0, NotSerialized)
{
- Return (TBSW << 3)
+ Return (ShiftLeft(TBSW, 3))
}
/* Mute audio */
Method (SSMS, 1, NotSerialized)