Change in osmo-ci[master]: lint: checkpatch.pl: fix && complaints

osmith gerrit-no-reply at lists.osmocom.org
Wed Jul 7 09:26:50 UTC 2021


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


Change subject: lint: checkpatch.pl: fix && complaints
......................................................................

lint: checkpatch.pl: fix && complaints

Don't complain with:
	ERROR:SPACING: space prohibited after that '&&' (ctx:ExW)
in code similar to:
	if (conn->conn->mode != MGCP_CONN_LOOPBACK
	    && conn->conn->mode != MGCP_CONN_RECV_ONLY
	    && !mgcp_rtp_end_remote_addr_available(&conn->end)) {

The check was supposed to complain about spaces if the && is used as
unary operator (to get the address of a goto label). But it's clearly
producing false positives in the Osmocom context with use as non-unary
operator, so remove this check.

Related: OS#5087
Related: https://github.com/torvalds/linux/commit/0d413866c7df63794790518e3fd5890969c206ad
Change-Id: I7ce79e6b291b3a3dab6587a589eeef0a0bc53de9
---
M lint/checkpatch/checkpatch.pl
1 file changed, 1 insertion(+), 1 deletion(-)



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

diff --git a/lint/checkpatch/checkpatch.pl b/lint/checkpatch/checkpatch.pl
index dc56812..ad99e0c 100755
--- a/lint/checkpatch/checkpatch.pl
+++ b/lint/checkpatch/checkpatch.pl
@@ -5072,7 +5072,7 @@
 				# unary operator, or a cast
 				} elsif ($op eq '!' || $op eq '~' ||
 					 $opv eq '*U' || $opv eq '-U' ||
-					 $opv eq '&U' || $opv eq '&&U') {
+					 $opv eq '&U') {  # Osmocom specific: &&U removed
 					if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) {
 						if (ERROR("SPACING",
 							  "space required before that '$op' $at\n" . $hereptr)) {

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

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I7ce79e6b291b3a3dab6587a589eeef0a0bc53de9
Gerrit-Change-Number: 24869
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/20210707/c86102fa/attachment.htm>


More information about the gerrit-log mailing list