Commit graph

30 commits

Author SHA1 Message Date
Kumar Gala
93da8dc478 Revert "checkpatch: update checkpatch to warn about C99 type usage"
Now that we are standardizing C99 integer types we can revert the commit
that warned about C99 type usage.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Stephanos Ioannidis
95c6da0c82 scripts: checkpatch: Revert dt-binding vendor prefix check regex change
This commit reverts the device tree binding vendor prefix check regular
expression change that was introduced by the following commit:
5b10fac97e

The changed regular expression fails to detect the correctly specified
vendor prefixes in the `vendor-prefixes.txt`.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-06 12:40:35 +02:00
Peter Bigot
afe8a3777a scripts: modify checkpatch to respect Zephyr for_each spelling
Linux uses for_each in macros that produce loops; Zephyr uses
FOR_EACH.  Update the corresponding checks to match Zephyr's spelling.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-02 11:23:13 -04:00
Peter Bigot
5b10fac97e scripts: update checkpatch to latest from the linux kernel
This takes the linux diffs between
a8c964eacb21288b2dbfa9d80cee5968a3b8fb21 and
16fbf79b0f83bc752cee8589279f1ebfe57b3b6e and applies them to the
Zephyr copy.  Three changes did not apply cleanly:

* linux added a comment to the line that enables C99 comments;
  Zephyr disallows them.
* linux uses vendor-prefixes.yaml; zephyr uses the older .txt file
* manual addition of colon in a check before BRACKET_SPACE error

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-02 11:23:13 -04:00
Flavio Ceolin
e86ec977fb syscalls: Remove references to __syscall_inline
There is no code to handle __syscall_inline so it is better removing
it from doxygen and checkpatch.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-12-09 12:47:15 -05:00
Antony Pavlov
8245195306 dts: import vendor-prefixes.txt from linux kernel
import linux-v5.1:Documentation/devicetree/bindings/vendor-prefixes.txt

Use vendor-prefixes.txt to check vendor prefixes
used in compatible strings and property names.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2019-05-22 12:40:20 -04:00
Antony Pavlov
f08148e640 scripts/checkpatch.pl: fix root dir detection and enable it
Don't try to find files specific for linux kernel.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2019-05-22 12:40:20 -04:00
Andrew Boie
41f6011c36 userspace: remove APPLICATION_MEMORY feature
This was never a long-term solution, more of a gross hack
to get test cases working until we could figure out a good
end-to-end solution for memory domains that generated
appropriate linker sections. Now that we have this with
the app shared memory feature, and have converted all tests
to remove it, delete this feature.

To date all userspace APIs have been tagged as 'experimental'
which sidesteps deprecation policies.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-02-08 07:04:30 -05:00
Anas Nashif
65f0c67906 checkpatch: downgrade COMPLEX_MACRO to a warning
This is generating lots of false positives and we keep overriding them
manually, so downgrade and mark it as a warning.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-08 08:56:12 -07:00
Anas Nashif
1eb244cf6c scripts: Update checkpatch to latest from the linux kernel
This is pulled from commit a8c964eacb21288b2dbfa9d80cee5968a3b8fb21 of
the Linux kernel with local zephyr related modifications.

Fixes #4135.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-02 18:48:56 -04:00
Andrew Boie
fa94ee7460 syscalls: greatly simplify system call declaration
To define a system call, it's now sufficient to simply tag the inline
prototype with "__syscall" or "__syscall_inline" and include a special
generated header at the end of the header file.

The system call dispatch table and enumeration of system call IDs is now
automatically generated.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-29 13:02:20 -07:00
Anas Nashif
c2de83c32f misc: remove MAINTAINERS file
Remove MAINTAINERS in favor of CODEOWNERS file which is supported by
github. Also remove scripts using this file and change checkpatch to
reference CODEOWNERS instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-08 15:08:18 -04:00
Anas Nashif
da871298b4 checkpatch: per coding style, we do not allow c++ style comments
Change-Id: I933f317f2117917bf6413fa0514342f6df4c1e90
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-28 13:03:33 +00:00
Kumar Gala
a48e8790d3 checkpatch: update checkpatch to warn about C99 type usage
Only in rare cases should we allow C99 types, so lets warn about it to
catch issues.

Change-Id: I2bacdd4ba98f88482e0b7acc0567ff1139e749bf
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 17:24:04 +00:00
Marcus Shawcroft
f62e681a5c checkpatch: Recognized volatile as part of a declaration.
Adjust the checkpatch script to recognize the volatile keyword as
forming part of a declaration.  This prevents inappropriate checkpatch
gripes for patches such as:

https://gerrit.zephyrproject.org/r/#/c/10345/

Change-Id: Ia29a9002bb9ef15f747d29231d938ae12790724d
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-22 14:56:44 +00:00
Anas Nashif
0f3d5478a8 checkpatch: update with latest checkpatch from the linux kernel
Update with commit 577f12c07e4edd54730dc559a9c7bc44d22bf7dc from
the Linux kernel.

Change-Id: Ie2cabbfea415d26ffacef340d9497342b496dc29
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-11 14:27:39 +00:00
Anas Nashif
49598db96d Revert "checkpatch: update with latest checkpatch from the linux kernel"
This reverts commit 0c9152d42d.

This was not ready for merge yet.

Change-Id: I08f69e27929867606bc58cdeffed6540725069a1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-10 12:48:33 -05:00
Anas Nashif
0c9152d42d checkpatch: update with latest checkpatch from the linux kernel
Update with commit 577f12c07e4edd54730dc559a9c7bc44d22bf7dc from the Linux
kernel.

Change-Id: I6314dd41eb200c87cdcc6f212f13d3351128de0d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-10 17:24:44 +00:00
Anas Nashif
34ffa15669 checkpatch: complain only about actual leading spaces
Change-Id: Ia591966a35765bfc560bd823be488257537e6530
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-19 16:46:41 +00:00
Javier B Perez
5eecd88011 checkpatch: kconfig: warn about spaces instead of tabs
checkpatch warns about kconfig lines that contains spaces
instead of tabs.

Change-Id: I60aa74072ce424f21db64a7df0804d7d4cbe315b
Jira: ZEP-427
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-06-21 19:50:59 +00:00
Anas Nashif
89205da16e checkpatch: catch changes to MAINTAINERS file
Change-Id: Iceb85f6e9fb3c66f89383f4d159d3752639356b1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-31 19:09:14 +00:00
Anas Nashif
92a12a19ae checkpatch: add option for excluding directories
when importing code from external sources, we do not want to fail
on checkpatch and want to run full sanity checks.

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.

Change-Id: I7d321e85eed6bc37d5c6879ae88e21d20028a433
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 16:05:42 +00:00
Vlad Dogaru
1cbfbe8426 checkpatch: Remove Change-Id warning
There seems to be no way to configure it, so I've just removed the code.

Change-Id: I35341e8afc0bdfa8b953b833cfb0eecf05b81c16
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-05-05 11:24:06 +00:00
Anas Nashif
0c8564cacb checkpatch: warn on COMPLEX_MACRO and MULTISTATEMENT_MACRO_USE_DO_WHILE
generates lots of false postives, so make it warn only.

Change-Id: I0b2fedc564c29bff32f7c48702a9ad54a969650b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-19 01:14:39 +00:00
Anas Nashif
e7ee08338b checkpatch: fix SPACE false positive
Fix issue where a space is required after a comma:

-:245: ERROR:SPACING: space required after that ',' (ctx:VxB)
+	SECTION_PROLOGUE(_NOINIT_DMA_SECTION_NAME, (NOLOAD OPTIONAL),)

Now we will ignore such errors if the comma is followed by a ).

Change-Id: Ib38161cd11e650764c319ba373a1f7c1a6d80df6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-22 19:11:41 +00:00
Anas Nashif
76b0913a33 checkpatch: update checkpatch to latest from upstream
Update to commit 6b10df4257367dd0ead49f88df473972c00a8b5c from the Linux
kernel, relevant changes since last update:

 - checkpatch: fix a number of COMPLEX_MACRO false positives
 - checkpatch: improve macros with flow control test
 - checkpatch: warn when casting constants to c90 int or longer types
 - checkpatch: improve the unnecessary initialisers tests
 - checkpatch: improve tests for fixes:, long lines and stack dumps in commit log

Change-Id: Ic4f8d925cd7c076e18eb2f2841913be61239aac2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-22 19:11:23 +00:00
Anas Nashif
98c50de9ff checkpatch: Allow space before [ in the case of inline asm
This allows the customary syntax for declaring named arguments,
such as:

asm ("mov %[out],%[in]" : [out] "=r" (x) : [in] "r" (y));

Since :[ is comple-error-inducingly invalid syntax in other cases,
this won't create unintentional leniency for normal uses of [

Originally from https://lkml.org/lkml/2010/11/16/145 by Dave Martin

Change-Id: Iead3fdb147ba2f6cbd108f19dd348bb72a7e6b6f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:42 -05:00
Anas Nashif
cbfb62c93d checkpatch: Update to latest version from the Linux kernel
Lots of enhancements and bug fixes but primarily it fixes an issue
where checkpatch was reporting errors in lines that have not changed.

Change-Id: If141a294b92cbabd4ad8978a40168abb062aebfb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:29 -05:00
Anas Nashif
b7881fecfa checkpatch: remove comment about MAINTAINERS file
Zephyr does not have a MAINTAINERS files, so remove the comment
about checking the file when reporting false positives to avoid
confusion.

Change-Id: I915dba009902a68d5e621603d22b7df57d84a1b1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:23 -05:00
Inaky Perez-Gonzalez
8ddf82cf70 First commit
Signed-off-by:  <inaky.perez-gonzalez@intel.com>
2015-04-10 16:44:37 -07:00