From 121f05cf2028bc3e560ae54ea59e48dc027f9e64 Mon Sep 17 00:00:00 2001 From: Florian Pose Date: Fri, 21 Aug 2026 16:48:37 +0200 Subject: [PATCH] Created CPPLINT exceptions for device drivers. --- devices/CPPLINT.cfg | 10 ++++++++++ devices/e1000/CPPLINT.cfg | 18 ++++++++++++++++++ devices/e1000e/CPPLINT.cfg | 15 +++++++++++++++ devices/genet/CPPLINT.cfg | 16 ++++++++++++++++ devices/igb/CPPLINT.cfg | 16 ++++++++++++++++ devices/igc/CPPLINT.cfg | 16 ++++++++++++++++ devices/macb/CPPLINT.cfg | 15 +++++++++++++++ devices/r8169/CPPLINT.cfg | 12 ++++++++++++ devices/stmmac/CPPLINT.cfg | 17 +++++++++++++++++ 9 files changed, 135 insertions(+) create mode 100644 devices/e1000/CPPLINT.cfg create mode 100644 devices/e1000e/CPPLINT.cfg create mode 100644 devices/genet/CPPLINT.cfg create mode 100644 devices/igb/CPPLINT.cfg create mode 100644 devices/igc/CPPLINT.cfg create mode 100644 devices/macb/CPPLINT.cfg create mode 100644 devices/r8169/CPPLINT.cfg create mode 100644 devices/stmmac/CPPLINT.cfg diff --git a/devices/CPPLINT.cfg b/devices/CPPLINT.cfg index eca3e2d8..c9d5b6aa 100644 --- a/devices/CPPLINT.cfg +++ b/devices/CPPLINT.cfg @@ -7,3 +7,13 @@ # top-level CPPLINT.cfg, so it only relaxes tab checking for the # driver tree -- master code elsewhere continues to be checked. filter=-whitespace/tab + +# A few older native drivers (8139too, e100, and the pre-devices/r8169/ +# legacy r8169 versions) still live directly in this directory instead +# of their own subdirectory, side by side with hand-written EtherCAT +# glue code (ecdev.h, generic.c). Per-driver style exceptions (see e.g. +# devices/igb/CPPLINT.cfg) can only be scoped per-directory, so they +# can't be given to just these files here without also loosening the +# checks for the hand-written code. Exempt them by name instead; the +# hand-written files keep full linting. +exclude_files=^(8139too|e100|r8169)-.*\.[ch]$ diff --git a/devices/e1000/CPPLINT.cfg b/devices/e1000/CPPLINT.cfg new file mode 100644 index 00000000..a8a5f1e4 --- /dev/null +++ b/devices/e1000/CPPLINT.cfg @@ -0,0 +1,18 @@ +# The e1000 driver is a lightly patched copy of the in-kernel e1000 +# driver (see update.sh), kept close to upstream formatting so future +# updates can be diffed/merged against new kernel sources with minimal +# noise. The checks below mostly fire on plain kernel coding-style +# idioms (long lines, blank lines at block boundaries, spacing around +# operators/commas, C-style casts, empty ";"-only statements, trailing +# whitespace) that have nothing to do with the EtherCAT integration +# bits; reformatting the copied parts to satisfy them would defeat the +# purpose of keeping the diff small. This filter is added on top of +# (not instead of) devices/CPPLINT.cfg and the top-level CPPLINT.cfg. +filter=-build/include +filter=-runtime/casting +filter=-whitespace/blank_line +filter=-whitespace/comma +filter=-whitespace/end_of_line +filter=-whitespace/line_length +filter=-whitespace/operators +filter=-whitespace/semicolon diff --git a/devices/e1000e/CPPLINT.cfg b/devices/e1000e/CPPLINT.cfg new file mode 100644 index 00000000..51c7ae4d --- /dev/null +++ b/devices/e1000e/CPPLINT.cfg @@ -0,0 +1,15 @@ +# The e1000e driver is a lightly patched copy of the in-kernel e1000e +# driver (see update.sh), kept close to upstream formatting so future +# updates can be diffed/merged against new kernel sources with minimal +# noise. The checks below mostly fire on plain kernel coding-style +# idioms (long lines, blank lines at block boundaries, C-style casts, +# empty ";"-only statements) that have nothing to do with the EtherCAT +# integration bits; reformatting the copied parts to satisfy them would +# defeat the purpose of keeping the diff small. This filter is added on +# top of (not instead of) devices/CPPLINT.cfg and the top-level +# CPPLINT.cfg. +filter=-build/include +filter=-runtime/casting +filter=-whitespace/blank_line +filter=-whitespace/line_length +filter=-whitespace/semicolon diff --git a/devices/genet/CPPLINT.cfg b/devices/genet/CPPLINT.cfg new file mode 100644 index 00000000..4056671d --- /dev/null +++ b/devices/genet/CPPLINT.cfg @@ -0,0 +1,16 @@ +# The genet driver is a lightly patched copy of the in-kernel bcmgenet +# driver (see update.sh), kept close to upstream formatting so future +# updates can be diffed/merged against new kernel sources with minimal +# noise. The checks below mostly fire on plain kernel coding-style +# idioms (long lines, blank lines at block boundaries, trailing +# whitespace) or on the fact that the copied upstream header unimac.h +# carries no copyright notice of its own; none of this has anything to +# do with the EtherCAT integration bits, and reformatting the copied +# parts to satisfy them would defeat the purpose of keeping the diff +# small. This filter is added on top of (not instead of) devices/ +# CPPLINT.cfg and the top-level CPPLINT.cfg. +filter=-build/include +filter=-legal/copyright +filter=-whitespace/blank_line +filter=-whitespace/end_of_line +filter=-whitespace/line_length diff --git a/devices/igb/CPPLINT.cfg b/devices/igb/CPPLINT.cfg new file mode 100644 index 00000000..02199b4d --- /dev/null +++ b/devices/igb/CPPLINT.cfg @@ -0,0 +1,16 @@ +# The igb driver is a lightly patched copy of the in-kernel igb driver +# (see update.sh), kept close to upstream formatting so future updates +# can be diffed/merged against new kernel sources with minimal noise. +# The checks below mostly fire on plain kernel coding-style idioms +# (long lines, blank lines at block boundaries, C-style casts, empty +# ";"-only statements, multi-line string literals) that have nothing to +# do with the EtherCAT integration bits; reformatting the copied parts +# to satisfy them would defeat the purpose of keeping the diff small. +# This filter is added on top of (not instead of) devices/CPPLINT.cfg +# and the top-level CPPLINT.cfg. +filter=-build/include +filter=-readability/multiline_string +filter=-runtime/casting +filter=-whitespace/blank_line +filter=-whitespace/line_length +filter=-whitespace/semicolon diff --git a/devices/igc/CPPLINT.cfg b/devices/igc/CPPLINT.cfg new file mode 100644 index 00000000..68fa78ae --- /dev/null +++ b/devices/igc/CPPLINT.cfg @@ -0,0 +1,16 @@ +# The igc driver is a lightly patched copy of the in-kernel igc driver +# (see update.sh), kept close to upstream formatting so future updates +# can be diffed/merged against new kernel sources with minimal noise. +# The checks below mostly fire on plain kernel coding-style idioms +# (long lines, blank lines at block boundaries, C-style casts, missing +# space after a comma, empty ";"-only statements) that have nothing to +# do with the EtherCAT integration bits; reformatting the copied parts +# to satisfy them would defeat the purpose of keeping the diff small. +# This filter is added on top of (not instead of) devices/CPPLINT.cfg +# and the top-level CPPLINT.cfg. +filter=-build/include +filter=-runtime/casting +filter=-whitespace/blank_line +filter=-whitespace/comma +filter=-whitespace/line_length +filter=-whitespace/semicolon diff --git a/devices/macb/CPPLINT.cfg b/devices/macb/CPPLINT.cfg new file mode 100644 index 00000000..932c665b --- /dev/null +++ b/devices/macb/CPPLINT.cfg @@ -0,0 +1,15 @@ +# The macb driver is a lightly patched copy of the in-kernel macb/GEM +# driver (see update.sh), kept close to upstream formatting so future +# updates can be diffed/merged against new kernel sources with minimal +# noise. The checks below mostly fire on plain kernel coding-style +# idioms (long lines, blank lines at block boundaries, missing space +# after a comma, an upstream header that already includes +# linux/inetdevice.h twice) that have nothing to do with the EtherCAT +# integration bits; reformatting the copied parts to satisfy them would +# defeat the purpose of keeping the diff small. This filter is added on +# top of (not instead of) devices/CPPLINT.cfg and the top-level +# CPPLINT.cfg. +filter=-build/include +filter=-whitespace/blank_line +filter=-whitespace/comma +filter=-whitespace/line_length diff --git a/devices/r8169/CPPLINT.cfg b/devices/r8169/CPPLINT.cfg new file mode 100644 index 00000000..76e03f45 --- /dev/null +++ b/devices/r8169/CPPLINT.cfg @@ -0,0 +1,12 @@ +# The r8169 driver is a lightly patched copy of the in-kernel r8169 +# driver (see update.sh), kept close to upstream formatting so future +# updates can be diffed/merged against new kernel sources with minimal +# noise. The checks below mostly fire on plain kernel coding-style +# idioms (long lines, blank lines at block boundaries) that have +# nothing to do with the EtherCAT integration bits; reformatting the +# copied parts to satisfy them would defeat the purpose of keeping the +# diff small. This filter is added on top of (not instead of) devices/ +# CPPLINT.cfg and the top-level CPPLINT.cfg. +filter=-build/include +filter=-whitespace/blank_line +filter=-whitespace/line_length diff --git a/devices/stmmac/CPPLINT.cfg b/devices/stmmac/CPPLINT.cfg new file mode 100644 index 00000000..42dc42bb --- /dev/null +++ b/devices/stmmac/CPPLINT.cfg @@ -0,0 +1,17 @@ +# The stmmac driver is a lightly patched copy of the in-kernel stmmac +# driver (see update.sh), kept close to upstream formatting so future +# updates can be diffed/merged against new kernel sources with minimal +# noise. The checks below mostly fire on plain kernel coding-style +# idioms (long lines, blank lines at block boundaries, GCC-style +# variable-length arrays sized by a compile-time constant) or on the +# fact that several of the copied upstream source files carry no +# copyright notice of their own; none of this has anything to do with +# the EtherCAT integration bits, and reformatting the copied parts to +# satisfy them would defeat the purpose of keeping the diff small. This +# filter is added on top of (not instead of) devices/CPPLINT.cfg and +# the top-level CPPLINT.cfg. +filter=-build/include +filter=-legal/copyright +filter=-runtime/arrays +filter=-whitespace/blank_line +filter=-whitespace/line_length