laforge submitted this change.

View Change

Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified
Revert "checkpatch: recognize json_array_foreach etc."

Turns out we don't want to treat loop macros the same as real for/while
etc. regarding spaces.

Harald wrote:
> Those macros are used without space before the open parenthesis, for
> decades in the kernel and also in osmocom

This reverts commit afd9d56e0568a61d0b2de010f710baffb71bff25.

Related: https://gerrit.osmocom.org/c/osmo-sgsn/+/37864/comment/7eada1b7_0e584088/
Change-Id: I59d4a89cca516df8346fc090f532d42fc9d6acac
---
M lint/checkpatch/checkpatch.pl
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lint/checkpatch/checkpatch.pl b/lint/checkpatch/checkpatch.pl
index ff6eea1..eada2a9 100755
--- a/lint/checkpatch/checkpatch.pl
+++ b/lint/checkpatch/checkpatch.pl
@@ -4888,7 +4888,6 @@
# Ignore those directives where spaces _are_ permitted.
if ($name =~ /^(?:
if|for|while|switch|return|case|
- [a-z_]*for[_]?each[a-z_]*|
volatile|__volatile__|
__attribute__|format|__extension__|
asm|__asm__)$/x)
@@ -5514,7 +5513,7 @@
}

# Need a space before open parenthesis after if, while etc
- if ($line =~ /\b(if|while|for|switch|[a-z_]*for[_]?each[a-z_]*)\(/) {
+ if ($line =~ /\b(if|while|for|switch)\(/) {
if (ERROR("SPACING",
"space required before the open parenthesis '('\n" . $herecurr) &&
$fix) {

To view, visit change 37904. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I59d4a89cca516df8346fc090f532d42fc9d6acac
Gerrit-Change-Number: 37904
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>