summaryrefslogtreecommitdiff
path: root/tools/checkpatch.pl
AgeCommit message (Collapse)Author
2025-01-07tools: we specifically added %Lu to our sprintfrr so allow itChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-07-31tools/checkpatch: recognize `+` as unary operatorDavid Lamparter
Allow using "+1" when meaningful (i.e. cmd_graph_merge wants -1 or +1) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-06-21tools/checkpatch: accept pim_* typedefsDavid Lamparter
pimd uses "v4/v6 dispatch" typedefs. Don't complain about those in checkpatch. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-03-04doc, tools: Remove ARRAY_SIZE checkDonald Sharp
checkpatch.pl wants you to use ARRAY_SIZE in a kernel header file. We don't have access to this kernel header file for normal compilation. I'm just going to remove it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-22*: convert `struct interface->connected` to DLISTDavid Lamparter
Replace `struct list *` with `DLIST(if_connected, ...)`. NB: while converting this, I found multiple places using connected prefixes assuming they were IPv4 without checking: - vrrpd/vrrp.c: vrrp_socket() - zebra/irdp_interface.c: irdp_get_prefix(), irdp_if_start(), irdp_advert_off() (these fixes are really hard to split off into separate commits as that would require going back and reapplying the change but with the old list handling) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-11-06tools: checkpatch updated with darr_foreach iter macrosChristian Hopps
Also update `checkpatch.sh` so it runs `checkpatch.pl` from the same directory it resides in. This allows copying them both somewhere else to use a specific version. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-11-06mgmtd: simplify xpath registriesChristian Hopps
- move from client id indexed array of uints for register info per client to a u64 bitmask. - add bit walking FOREACH macro Walk the client IDs whose bits are set in a mask. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-20tools: checkpatch: FRR modifications to linux checkpatch.plChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-20tools: unmodified import of scripts/checkpatch.pl from linuxChristian Hopps
0ee3e7b8893e * checkpatch: get default codespell dictionary path from package location Signed-off-by: Christian Hopps <chopps@labn.net>
2023-02-10tools: allow // SPDX... in checkpatch.plDavid Lamparter
Using // style comments for the SPDX license identifier was kind of an intentional choice to make it stand out as "directive-like" comment (and also to constrain it to the one line.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09*: manual SPDX License ID conversionsDavid Lamparter
The files converted in this commit either had some random misspelling or formatting weirdness that made them escape automated replacement, or have a particularly "weird" licensing setup (e.g. dual-licensed.) This also marks a bunch of "public domain" files as SPDX License "NONE". Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-14tools: disable printf ext checks in checkpatchDavid Lamparter
checkpatch.pl has a hardcoded list of printf extensions supported... by the Linux kernel. This happens to have covered the ones we have in FRR so far, but `%pPA` isn't on the list and others may not be either. Since we have the frr-format GCC plugin (and CI runs that on Debian 11) we don't really need these checks in checkpatch.pl. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-19tools: remove Linux kernel bits from checkpatchDavid Lamparter
These aren't appropriate for use in FRR. Among other things, this enables running checkpatch by calling it in a git working tree with `tools/checkpatch.pl -g origin/master..` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-19tools: add iterators to checkpatchDavid Lamparter
For the purpose of allowing the space in `frr_each (`, copy the list of iterators from .clang-format and wire it up appropriately. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-02-01tools/checkpatch: downgrade string concat warningDavid Lamparter
This is the best I can make the asm blocks in lib/xref.h look, so just mute the warning. (It shouldn't come in relevant for other code.) Signed-off-by: David Lamparter <equinox@diac24.net>
2019-09-03tools: extend checkpatch.pl for frr_{with,each}David Lamparter
For frr_each, just fix some existing warnings; for frr_with_* add a warning indicating that braces should always be used. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-05-08tools: add lints for unsafe functionsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-12-09tools: update checkpatch to stop suggesting the use of kstrto()Renato Westphal
kstrto() is a kernel-specific function so this suggestion doesn't make sense for FRR. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-11-19tools: add non-32 bit atomic warning to checkpatchQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-10-27tools: update checkpatch to allow indented labelsRenato Westphal
clang-format always indent labels by default and that can't be changed with any configuration option. Also, indented labels tend to improve code readability, especially in long functions. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-09-19tools/checkpatch.pl: recognize _Atomic as modifierDavid Lamparter
checkpatch is slightly confused by _Atomic, causing some spurious warnings. Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-10tools/checkpatch: fix some bogus macro warningsDavid Lamparter
checkpatch was throwing an error for "#define FOO , bar" Signed-off-by: David Lamparter <equinox@diac24.net>
2018-03-30Merge pull request #1955 from qlyoung/stylecheckerOlivier Dugeon
tools: do not check for kernel macros
2018-03-27Merge branch 'master' into stylecheckerQuentin Young
2018-03-27tools, doc: update checkpatch for u_int_*Quentin Young
* Checkpatch.pl now checks for nonstandard integral types * Add shell script to replace all nonstandard types with their standard counterparts in C source files * Document usage of types, mention conversion script Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-22tools: do not check for kernel macrosQuentin Young
Certain things checked for by checkpatch.pl are kernel-specific macros we don't have. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-14tools: checkpatch.sh - Add warning that // style comments don't matchLou Berger
recommended (kernel) comment style Signed-off-by: Lou Berger <lberger@labn.net>
2018-02-23tools: finer-grained error codes for checkpatchQuentin Young
* 2 for errors * 1 for warnings * 0 for clean * Suppress all report text for a clean result * Remove check for const structs from perl script * Remove grep suppression for that check from shell script Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-02-23tools: ignore FSF warning, fn macros in checkpatchQuentin Young
* Unlike Linux we do require the GPL file header * When checking for spaces between function names and parentheses, ignore all-uppercase function names as these are likely to be macros, and function-like macros may have that space Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-12-20tools: add style checking scriptsQuentin Young
Add shell script and modified checkpatch.pl for use with patch files targeting FRR. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>