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

osmith gerrit-no-reply at lists.osmocom.org
Fri Jul 30 08:11:57 UTC 2021


osmith has submitted this change. ( 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(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  neels: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved; Verified



diff --git a/lint/checkpatch/checkpatch.pl b/lint/checkpatch/checkpatch.pl
index ca074a7..059a2a6 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" },
+				# 	{ .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;

-- 
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: 2
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210730/595c3087/attachment.htm>


More information about the gerrit-log mailing list