From dbc4e6e78fb4b961b2acaeddcb557987a3d8a037 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Mon, 19 Jul 2021 14:03:53 +0200 Subject: [PATCH] lint: checkpatch.pl: no spaces required for tdef Don't require spaces around equals sign for tdef entries. Related: OS#5087 Change-Id: I1f0b9ed5bd49ef9b5ab0e347b9260e71df34ff9c --- lint/checkpatch/checkpatch.pl | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/lint/checkpatch/checkpatch.pl b/lint/checkpatch/checkpatch.pl index ca074a75..059a2a6c 100755 --- a/lint/checkpatch/checkpatch.pl +++ b/lint/checkpatch/checkpatch.pl @@ -5170,6 +5170,33 @@ sub process { } } + # Osmocom specific: do not require spaces + # around the equals sign (=) inside + # struct osmo_tdef entries. (Assuming this is + # the case if the line contains '.T='.) + # + # Usually: + # struct osmo_tdef global_T_defs[] = { + # { .T=7, .default_val=50, .desc="Water Boiling Timeout" }, + # { .T=8, .default_val=300, .desc="Tea brewing" }, + # { .T=9, .default_val=5, .unit=OSMO_TDEF_M, .desc="Let tea cool down" }, + # { .T=10, .default_val=20, .unit=OSMO_TDEF_M, .desc="Forgot to drink tea" }, + # {} + # }; + # + # Another example: + # struct osmo_tdef fr_tdefs[] = { + # { + # .T=391, // <- only here no spaces around "=" + # .default_val = 10, + # .min_val = 5, + # .max_val = 30, + # .desc = "Link integrity verification polling timer", + # .unit = OSMO_TDEF_S, + # }, ... + } elsif ($opline =~ /\.T=/) { + # pass + # All the others need spaces both sides. } elsif ($ctx !~ /[EWC]x[CWE]/) { my $ok = 0;