Commit graph

119 commits

Author SHA1 Message Date
Martin Roth
e76cd0eb9c UPSTREAM: util/lint: Give better warning for help spacing issue
Because the help block uses significant whitespace to determine whether
or not text is inside the help block, a mixture of spaces and tabs
confuses the parser.
If there's an unrecognized line, and the previous line was inside a help
block, it's likely that this line is too.

Additionally, this was found with a line that started '  configuration',
and threw a perl warning about an uninitialized value because the parser
thought this was the start of a new config line, but couldn't find the
symbol.  Now we make sure that config statements have whitespace after
the 'config' statement.

BUG=none
BRANCH=none
TEST=none

Change-Id: I5d564165c3842bb64f16db1ee85d24d4bd2dfc52
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Original-Commit-Id: 811d93af39
Original-Change-Id: I46375738a18903b266ea9fff3102a1a91235e609
Original-Signed-off-by: Martin Roth <gaumless@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/19155
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://chromium-review.googlesource.com/528268
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2017-06-12 08:47:54 -07:00
Martin Roth
1bfe43b6c4 UPSTREAM: util/lint/kconfig_lint: update help checking
- Turn the check for help text with no indentation from a warning to
an error.
- Show an error if the help text is at the same indentation level as
the 'help' keyword.

BUG=none
BRANCH=none
TEST=none

Change-Id: I743c991b27887e6e02b45fe1ec42a06005a4dc07
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Original-Commit-Id: 8849f3be4a
Original-Change-Id: Ibf868c83e2a128ceb6c4d3da7f2cf7dc237054e6
Original-Signed-off-by: Martin Roth <martinroth@google.com>
Original-Reviewed-on: https://review.coreboot.org/19851
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/528266
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2017-06-12 08:47:54 -07:00
Patrick Georgi
7289f786d1 UPSTREAM: util/lint: ignore some more binary file types
Namely png (images) and eot, ttf, woff (fonts)

BUG=none
BRANCH=none
TEST=none

Change-Id: I34654dcc6c7f4b6eae00c69c55d58b6b012fce20
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Original-Commit-Id: 9ec25f7678
Original-Change-Id: I41e773c0adab796876a3b1e91e089ae89cbb04df
Original-Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Original-Reviewed-on: https://review.coreboot.org/19880
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/517923
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2017-05-29 01:59:13 -07:00
Martin Roth
4d3d353c47 UPSTREAM: util/lint: Don't run checkpatch on the documentation
BUG=none
BRANCH=none
TEST=none

Change-Id: Ia4f66233046dedd21e2bc5bf48ca7d7d514612b4
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 2a063beb71
Original-Change-Id: Ib95a7c9c64c481af7dcf1074ffc0fc76dc6b6ff9
Original-Signed-off-by: Martin Roth <gaumless@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/19144
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Philippe Mathieu-Daud <philippe.mathieu.daude@gmail.com>
Original-Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/486751
2017-04-26 09:20:56 -07:00
Martin Roth
67be62a90b UPSTREAM: util/lint: Show an error if a symbol is created in two choice blocks
Kconfig shows a warning about this, but we want to catch it earlier
and halt the build.

BUG=none
BRANCH=none
TEST=none

Change-Id: Ib1cd0d029527f51d822eb9d22fb939d96aac4460
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: aa206478cb
Original-Change-Id: I0acce1d40a6ca2b212c638bdb1ec65de5bd4d726
Original-Signed-off-by: Martin Roth <martinroth@google.com>
Original-Reviewed-on: https://review.coreboot.org/18970
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Subrata Banik <subrata.banik@intel.com>
Original-Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://chromium-review.googlesource.com/459509
2017-03-29 11:42:14 -07:00
Martin Roth
566f0d168e UPSTREAM: 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.

BUG=none
BRANCH=none
TEST=none

Change-Id: I69e9577374579bf24736b2961285938c124df8c0
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 010905ed2f
Original-Change-Id: Ieb0c96027e8df842f60ca7c9de7aac941eed1dc2
Original-Signed-off-by: Martin Roth <martinroth@google.com>
Original-Reviewed-on: https://review.coreboot.org/18570
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/452366
2017-03-09 05:14:36 -08:00
Martin Roth
7873f99314 UPSTREAM: 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@intel.com>

BUG=none
BRANCH=none
TEST=none

Change-Id: Ifdd76bc8f440e6cbb478fabd3b1a7bce55d1009f
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: a3cac87ea8
Original-Change-Id: Icc9e841e7d84026d6ab857ff90b0f093515ccaad
Original-Signed-off-by: Martin Roth <martinroth@google.com>
Original-Reviewed-on: https://review.coreboot.org/18568
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Original-Reviewed-by: Philippe Mathieu-Daud <philippe.mathieu.daude@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/452364
2017-03-09 05:14:35 -08:00
Martin Roth
527b3c1da5 UPSTREAM: util/lint: Don't check license text for files with under 5 lines
BUG=none
BRANCH=none
TEST=none

Change-Id: Ie3271826bc6a5094d3a376a0a44a7be5e3c696c9
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Original-Commit-Id: 03e9d6aa13
Original-Change-Id: I7c1e3cf558d447838819b4d6a63d93d48d5f13e0
Original-Signed-off-by: Martin Roth <martinroth@google.com>
Original-Reviewed-on: https://review.coreboot.org/18316
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Jonathan Neuschfer <j.neuschaefer@gmx.net>
Original-Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://chromium-review.googlesource.com/443679
2017-02-17 04:09:19 -08:00
Martin Roth
639a030e9d UPSTREAM: util/lint: Add a tool to verify a single newline at the end of files
This takes way too long to run - currently about 30 seconds to look
at the entire coreboot tree.

Change-Id: I5edc77bc808665ef9832970f5a6458ffe8c04ee1
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 2e03fbced7
Original-Change-Id: I403934014b422528715ea95ff652babe5e18c88b
Original-Signed-off-by: Martin Roth <martinroth@google.com>
Original-Reviewed-on: https://review.coreboot.org/15976
Original-Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/430716
2017-01-20 08:47:59 -08:00
Martin Roth
4a5cc9cb44 UPSTREAM: util/lint: Add check for the signed-off-by line
Gerrit will let you push a patch without a signed-off-by line,
although I believe it can't actually be merged.  Instead of catching
it either manually, or when the patch is attempting to be merged,
catch this in the jenkins builder.

BUG=none
BRANCH=none
TEST=none

Change-Id: I5964d9b029ddbc72e39ca9c9db0def8d9f8d61b8
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 23ceb7d240
Original-Change-Id: I80161befa157266dd4e3209839a06ff398aab6bb
Original-Signed-off-by: Martin Roth <martinroth@google.com>
Original-Reviewed-on: https://review.coreboot.org/17941
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/427464
2017-01-13 15:21:48 -08:00
Martin Roth
2a7983e545 UPSTREAM: lint/kconfig_lint: Make sure all symbols have a type defined
Show an error if a symbol does not have a defined type.

This caused a problem of an undefined symbol in check_defaults, so
we just skip those symbols there as we can't verify the default pattern
without knowing the type.

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17345
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@googlemail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>

Change-Id: I28711a77962e16f6fc89789400363edd0fdd0931
Reviewed-on: https://chromium-review.googlesource.com/419632
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-13 17:49:45 -08:00
Martin Roth
b24ce01809 UPSTREAM: util/lint: add check for auto-included headers
Since we've removed them from the tree, add a check to keep them out.

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17658
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>

Change-Id: I2995da765fee8796a297963d54a1c34f56376efe
Reviewed-on: https://chromium-review.googlesource.com/419631
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-13 17:49:43 -08:00
Martin Roth
7550586ec8 UPSTREAM: util/lint: Add check to verify saved configs are miniconfigs
BUG=None
BRANCH=None
TEST=None

Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17600
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins)

Change-Id: Ifc5ec645dd27663c1b1fde9ff16d48534606a554
Reviewed-on: https://chromium-review.googlesource.com/418443
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-09 03:30:09 -08:00
Martin Roth
4df1b157a7 UPSTREAM: util/lint: Add check for symbolic links in the coreboot tree
Because of the varied environments that coreboot is built under, we
don't want to have symbolic links in the tree.

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17633
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>

Change-Id: I4cf9d95a437626cb52e3032a5e6cba83320a334b
Reviewed-on: https://chromium-review.googlesource.com/415631
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-01 00:50:49 -08:00
Naresh G Solanki
5f8c322745 UPSTREAM: util/lint: Exclude devicetree files with custom name from license check
As devicetree files can have different name followed by extension cb
Exclude all .cb file from the license header check.

BUG=None
BRANCH=None
TEST=None

Change-Id: I37b651eedd77cbf3d3e65ff0f027f971b0a2d2ac
Signed-off-by: Naresh G Solanki <naresh.solanki@intel.com>
Reviewed-on: https://review.coreboot.org/17186
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://chromium-review.googlesource.com/415628
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-01 00:50:42 -08:00
Martin Roth
caeb840847 UPSTREAM: kconfig_lint: More updates for excluded files
- All of the symbols are in the .config, so if .config is include in
the search all of the symbols are always found.
- There are now some Kconfig symbols in the Documentation directory,
so that needs to be excluded.
- 3rdparty has lots of Kconfig symbols that are unrelated to what
is being searched for.

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17588
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>

Change-Id: I0ff56d0a0916338a8b94f5210b8e0b3be5194f41
Reviewed-on: https://chromium-review.googlesource.com/415088
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-30 02:53:35 -08:00
Martin Roth
88f22b049d UPSTREAM: kconfig_lint: exclude payloads from search, add back specific files
Don't search for symbols in the payloads directory, except for specific
files that are actively added back to the search.

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17443
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>

Change-Id: I6f28dc7dee040b8061fa5644066f3613367b6d84
Reviewed-on: https://chromium-review.googlesource.com/415087
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-30 02:53:33 -08:00
Martin Roth
6a91cfd6d3 UPSTREAM: util/lint/lint: Show lint script output as it's running
The checkpatch script takes a really long time to run, and when the
output is buffered to wait until it's finished, it's hard to tell if
the script is actually doing anything.

Instead, use tee to log the output and display it at the same time.

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17125
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)

Change-Id: I3cf36e5e6ca28584103888ee1c6f125320ac068a
Reviewed-on: https://chromium-review.googlesource.com/404681
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-10-29 15:16:30 -07:00
Martin Roth
3f619b2fcb UPSTREAM: Revert "util/lint/kconfig_lint: change warning levels and text"
This reverts commit dfdb0733a6a71b11d15006dafc13841e84fab7cd.

BUG=None
BRANCH=None
TEST=None

Reviewed-on: https://review.coreboot.org/16868
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)

Change-Id: I91bf5e42f4ac241f544742ce161bae651f9f9947
Reviewed-on: https://chromium-review.googlesource.com/392870
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-10-04 21:18:52 -07:00
Martin Roth
931ac26cfa UPSTREAM: util/lint/kconfig_lint: change warning levels and text
- Add an exception for MAINBOARD_POWER_ON_AFTER_POWER_FAIL when checking
- With those exceptions set, we don't have anymore #define or #ifdef
warnings, so turn them to errors so no more can be pushed.
- Change the definition of an unused symbol from a warning to a note.
There are times when unused symbols are expected.
- Upgrade the warning for loading Kconfig files multiple times from
a warning to an error.

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16840
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>

Change-Id: I6dcb06d4f0b099d5ccaf7643e72dd790719bdf58
Reviewed-on: https://chromium-review.googlesource.com/392868
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-10-04 21:18:47 -07:00
Martin Roth
46ac826ace UPSTREAM: util/lint/kconfig_lint: Check default types
The type of the default value wasn't being checked to make sure that it
matched the type of the Kconfig symbol.

This makes sure that the symbol is being set to either a reasonable
looking value or to another Kconfig symbol.

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16839
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>

Change-Id: Ia01bd2d8b387f319d29f0a005d55cb8e20cd3853
Reviewed-on: https://chromium-review.googlesource.com/392867
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-10-04 21:18:45 -07:00
Martin Roth
58dde171d5 UPSTREAM: checkpatch.pl: ignore '#define asmlinkage'
checkpatch warns that the asmlinkage storage class should be at the
beginning of the declaration when we define it to be an empty value.

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16358
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>

Change-Id: I12292d5b42bf6da9130bb969ebe00fca8efcf049
Reviewed-on: https://chromium-review.googlesource.com/388295
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-09-22 08:55:09 -07:00
Martin Roth
4d9250ce09 UPSTREAM: lint/lint-007-checkpatch: Update lint script
- Check Kconfig files as well.
- Accept a list of directories to check as a command line argument.
- Only look at src & util directories by default.
- Skip src/vendorcode.
- Remove bypass of payloads/coreinfo/util/kconfig directory, it no
longer exists.

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16359
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>

Change-Id: Ia522d3ddc29914220bdaae36ea23ded7338c48fd
Reviewed-on: https://chromium-review.googlesource.com/388294
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-09-22 08:55:07 -07:00
Nico Huber
7a0fc734ee UPSTREAM: Add minimal GNAT run time system (RTS)
Add a stripped-down version of libgnat. This is somehow comparable to
libgcc but for Ada programs. It's licensed under GPLv3 but with the
runtime library exception. So it's totally fine to link it with our
GPLv2 code and keep it under GPLv2.

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Nico Huber <nico.huber@secunet.com>
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/11836
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>

Change-Id: Ie6522abf093f0a516b9ae18ddc69131bd721dc0c
Reviewed-on: https://chromium-review.googlesource.com/386273
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-09-21 19:36:46 -07:00
Martin Roth
6b3dc32b96 UPSTREAM: checkpatch.pl: Force raw_line to return a defined value
Fixes the warning:
Use of uninitialized value in concatenation (.) or string at
util/lint/checkpatch.pl line 4739

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16357
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>

Change-Id: Idc3c631735a595517d77cb8b8ec67e1ac00b6685
Reviewed-on: https://chromium-review.googlesource.com/385907
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-09-15 13:41:44 -07:00
Martin Roth
8b54b16aa5 UPSTREAM: lint/checkpatch.pl: Pull in coreboot fixes
This pulls in two fixes that were added to coreboot's checkpatch.pl
script:

- commit 82ef8ada (src/commonlib/lz4_wrapper: Correct inline asm for
unaligned 64-bit copy):
modify checkpatch.pl to ignore spaces before opening brackets when
used in inline assembly.

- commit ebef00fa (lint/checkpatch.pl: escape \{ in perl regex to fix
warnings):
Unescaped left brace in regex is deprecated, passed through in regex;

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16348
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>

Change-Id: Ia2c712c5b1bb5f67953a9098b5a076e31e3bd8d3
Reviewed-on: https://chromium-review.googlesource.com/385906
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-09-15 13:41:42 -07:00
Stefan Reinauer
00f664d0bd UPSTREAM: util/lint: Update to latest checkpatch.pl
Taken from upstream Linux kernel.

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/15980
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>

Change-Id: Id8c9d48b8ca3c7592dc4d78cfd092714bbbb2abf
Reviewed-on: https://chromium-review.googlesource.com/381667
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-09-07 00:16:42 -07:00
Martin Roth
4e0f8ec920 UPSTREAM: util/lint: Add a lint tool to find non-ascii & unprintable chars
This examines characters in coreboot's sourcecode to look for values
that are not TAB, or in the range of space (0x20) to ~ (0x7F).

It specifically excludes copyright lines so that names with high-
ASCII characters are not flagged.

BUG=None
BRANCH=None
TEST=None

Change-Id: Ia4fde98fc91f90fb693129fe26527fe580563745
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/15979
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/367369
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-08-09 17:11:31 -07:00
Benjamin Barenblat
6d3551d8ce UPSTREAM: src/commonlib/lz4_wrapper: Correct inline asm for unaligned 64-bit copy
Rewrite inline assembly for ARMv7+ to correctly annotate inputs and
outputs.  On ARM GCC 6.1.1, this causes assembly output to change from
the incorrect

	@ r0 is allocated to hold dst and x0
	@ r1 is allocated to hold src and x1
	ldr r0, [r1]		@ clobbers dst!
	ldr r1, [r1, #4]
	str r0, [r0]
	str r1, [r0, #4]

to the correct

	@ r0 is allocated to hold dst
	@ r1 is allocated to hold src and x1
	@ r3 is allocated to hold x0
	ldr r3, [r1]
	ldr r1, [r1, #4]
	str r3, [r0]
	str r1, [r0, #4]

Also modify checkpatch.pl to ignore spaces before opening brackets when
used in inline assembly.

Change-Id: I255995f5e0a7b1a95375258755a93972c51d79b8
Signed-off-by: Benjamin Barenblat <bbaren@google.com>
Reviewed-on: https://review.coreboot.org/15216
Tested-by: build bot (Jenkins)
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://chromium-review.googlesource.com/356445
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-27 17:12:45 -07:00
Alexander Couzens
ebef00faf6 lint/checkpatch.pl: escape \{ in perl regex to fix warnings
Fix warnings:
Unescaped left brace in regex is deprecated, passed through in regex;
marked by <-- HERE in m/\#\s*define.*do\s{ <-- HERE / at util/lint/checkpatch.pl line 3261.
marked by <-- HERE in m/\(.*\){ <-- HERE / at util/lint/checkpatch.pl line 3750.
marked by <-- HERE in m/do{ <-- HERE / at util/lint/checkpatch.pl line 3751.
marked by <-- HERE in m/^\({ <-- HERE / at util/lint/checkpatch.pl line 4194.

Change-Id: If0c1f07a16df9e6cd1c1393a31af8b8ea6a66b01
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: https://review.coreboot.org/14310
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-04-22 17:24:17 +02:00
Martin Roth
f790672f2d util/lint: Find unsigned variables with no length specified
The coding guidelines say that all objects should have fully
qualified types (unsigned int instead of unsigned).

This script finds violations of that rule.

Steps for the filter:
1) Find all lines in the coreboot tree that have the word 'unsigned'
followed by a space.
2) Exclude directories that aren't in the include list or
are specifically excluded.
3) Exclude files that aren't specifically included.
4) Filter out legimitate uses 'unsigned int' or 'unsigned long' for
example.
5) Filter out lines that begin with '/*' or '*'

Change-Id: I46213c6a168e6aafa29a50af814bf7e0fcd32eb6
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14269
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-04-21 23:13:09 +02:00
Martin Roth
3a6374c454 lint: Add check for amd & apple mainboard license headers
Change-Id: Idda4b7179e3e7b3f5b70be810b428b0651c1cd67
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14427
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-04-21 23:07:31 +02:00
Martin Roth
cd9aec6fb0 util/lint: Update lint-stable-000-license-headers
Add all currently clean directories.

Change-Id: Ibfb6432b485adb7fdc930f57ea0af4ff35921d37
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14332
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-04-14 17:46:48 +02:00
Martin Roth
84129b8c68 util/lint: update lint-000-license-headers
- Add some additional filters for files that do not require
license headers.
- Add an alternative wording for the BSD license that is used
in several files.
- Add string for dummy files
- Stop checking if there are no files left.
- Remove 'local' keyword which is not posix compliant.

Change-Id: I2ed1b0572b5fbe84ea86173b7ec2106454399547
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14324
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-04-13 17:37:53 +02:00
Martin Roth
e03305358f lint/lint-stable-004-style-labels: Update script
- Look at entire tree instead of just the current commit.  This was
causing the test to overlook some issues that were already in the tree.
- If git is on the system, and the code is in a git repo, use the
'git ls-files' command to find the files to examine.  If those
conditions aren't met, fall back to using the find command.
- Wrap the command so it's easier to read.

Change-Id: I3dce219a29ffb1ae56a31318b995e3ba8ea43e70
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14194
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-04-13 02:11:28 +02:00
Martin Roth
ef5a238cb9 lint/check_lint_tests: Add script that will break all stable tests
Add a script to help us verify that our lint tests are working.

This isn't finished, because it should test all of the failure modes.
Some of the tests, 008-kconfig in particular have a lot of ways
that they can fail.

Currently the Kconfig test is triggered by removing the board
name file in test 006.  This removes the only place the config
option for that board name is located.

Change-Id: If01c6daf1c99d097a19995b4befae90a3b5db2d6
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14198
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-04-10 18:13:01 +02:00
Martin Roth
92658db3ca lint: Update board status script to look at the whole tree
The board status script wasn't checking the entire tree to make sure
that all boards had board_info.txt files.  Also it would only print
out the first issue that was found.

Change-Id: I5f2fa9e564c805c6dbee7a35cab80c1c342567a5
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14118
Tested-by: build bot (Jenkins)
Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
2016-03-29 23:30:47 +02:00
Martin Roth
b1bca88a04 lint-kconfig: pipe stderr to stdout to catch script errors
Because the perl error messages go to stderr, we were not catching these
on the build server.  If the script has an issue, we want to know
immediately, so change the bash script that calls into the perl lint
tool to pipe these to stdout.

Change-Id: Ieeec9ccbd59177cfd1859a9738a4ee1fab803d28
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/13877
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-03-05 15:40:31 +01:00
Martin Roth
0e6c0e18e3 kconfig_lint: make sure if and endif statements are balanced
In Kconfig files, the 'if' and 'endif' statements need to match up. A
file can't start an if statement that's completed in the next file.

Add a check as the files are being parsed to make sure that they match
up correctly.

Change-Id: If51207ea037089ab84c768e5a868270468cf4c4f
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/13876
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-03-03 20:42:49 +01:00
Martin Roth
abf7d4d7e8 kconfig_lint: Fix checks when running in taint mode
The builders run perl scripts in taint mode, and some of the checks
that the kconfig lint script were running were tainted, causing
the script to terminate early when running on the servers.

This checks to see if taint mode is enabled, and untaints the path
if it is.  All external tools (git & grep) must be in
/bin, /usr/bin, or /usr/local/bin.
This also removes the check for unused kconfig files if taint mode
is enabled.

Change-Id: I8d1e1c32275f759d085759fb5d8a6c85d4f99539
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/13751
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
2016-02-24 19:24:03 +01:00
Martin Roth
44ef167d21 lint: Make sure site-local isn't committed to coreboot repo
Change-Id: I1dc9469e3d001fe0d5b0517d45679b056586b5b3
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/13556
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-02-16 22:47:39 +01:00
Martin Roth
5a70d6bdf2 kconfig_lint: update kconfig lint shell scripts
- Add lint-stable script with just error checking
- Enable warnings in addition to errors in non-stable test.
- Use git grep if the code is in a git repo now that exclusions are
working.
- Check for perl, and ask the user to install it if it isn't
available.

Change-Id: Ie60d21f4ef8a61d879f116eb2056eb805b0a55f2
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/13542
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
2016-02-10 17:17:56 +01:00
Martin Roth
15f4d8c1bb kconfig_lint: demote 'always defined' errors to warnings
To be able to run this as a lint-stable test, demote these to warnings
for now.  After the current CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL
issues get fixed, these can be promoted again.

Change-Id: I1432980eb0c871fc61c12dcc351f8d46513a7965
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/13541
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-02-09 21:52:45 +01:00
Martin Roth
662237614b kconfig_lint: Check for IS_ENABLED used on symbols without CONFIG_
This looks at the coreboot codebase for the IS_ENABLED macro, and
gives an error if there is a symbol used without the CONFIG_ prefix.
This only works for symbols of type bool.

A future check will be added for all symbols, but that will take
a significant amount of time to run, because each symbol will need
to be searched for individually.

Change-Id: I92f2de2d231610d1a788da965f21966d89c2f25c
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/13538
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-02-09 21:51:46 +01:00
Patrick Georgi
35852b9037 lint: test for assembler dialect switches
We prefer the default AT&T dialect on x86

Change-Id: I7a5778c82ab5df6e971dfc73e98373893cfeeb92
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/13135
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
2016-02-07 00:36:46 +01:00
Martin Roth
f8db028a32 lint: Check license headers for both paragraphs of the GPL
If the GPLv2 or GPLv2+ license header is being used on a
coreboot file, make sure it has two paragraphs as specified by
the Common License Header section in the developer guidelines
in the coreboot wiki.

Change-Id: Ifffa0fa7272f5a4b129d4b7b8a515f8795bc2401
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/13119
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-02-02 03:24:57 +01:00
Martin Roth
b5400ad412 kconfig_lint: Add readme document
The readme describes the operation and usage of kconfig_lint.
It also lists all the notes, warnings, and errors that kconfig_lint
looks for.

Change-Id: I873f394ff93fce42cd9638cbbad6134f1aef3a6a
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/13464
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-01-30 17:29:40 +01:00
Martin Roth
08cf90f860 kconfig_lint: add comments and whitespace fixes.
No functional changes.

Change-Id: I40284b68ddda7e19741c5306a8c74761c00e4b35
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/13463
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-01-30 17:29:26 +01:00
Martin Roth
ab2d777360 kconfig_lint: Skip temp files when looking for unused Kconfig files.
Don't warn on Kconfig.orig and Kconfig~ files when trying to verify
that all the Kconfig files in the coreboot source tree are being loaded.

Change-Id: Ie7babe60b29735e5ccc5f93f4e42ad82dfb47044
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/13462
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-01-30 17:29:04 +01:00
Martin Roth
b58d349ca9 kconfig_lint: Update prompt structure
- The prompts were not getting incremented, so each prompt for a symbol
would overwrite the previous.
- Record the menu each prompt is in.

Change-Id: Ia282a30344d5e135f4f2027be9aff0e49a4e5edb
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/13461
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-01-30 17:28:44 +01:00