Change in osmo-ci[master]: lint: checkpatch.pl: no spaces required for tdef

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

osmith gerrit-no-reply at lists.osmocom.org
Mon Jul 19 12:33:28 UTC 2021


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/24961 )


Change subject: lint: checkpatch.pl: no spaces required for tdef
......................................................................

lint: checkpatch.pl: no spaces required for tdef

Don't require spaces around equals sign for tdef entries.

Related: OS#5087
Change-Id: I1f0b9ed5bd49ef9b5ab0e347b9260e71df34ff9c
---
M lint/checkpatch/checkpatch.pl
1 file changed, 27 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/61/24961/1

diff --git a/lint/checkpatch/checkpatch.pl b/lint/checkpatch/checkpatch.pl
index ca074a7..0b9e334 100755
--- a/lint/checkpatch/checkpatch.pl
+++ b/lint/checkpatch/checkpatch.pl
@@ -5170,6 +5170,33 @@
 						}
 					}
 
+				# 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 before drinking" },
+				# 	{ .T=10, .default_val=20, .unit=OSMO_TDEF_M, .desc="Forgot to drink tea while it's warm" },
+				# 	{}
+				#   };
+				#
+				# 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;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/24961
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I1f0b9ed5bd49ef9b5ab0e347b9260e71df34ff9c
Gerrit-Change-Number: 24961
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210719/6f1ee361/attachment.htm>


More information about the gerrit-log mailing list