<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ci/+/26465">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">lint: checkpatch_osmo: ignore BRACES_NOT_NECESSARY<br><br>Don't complain about using braces when they could be omitted, for<br>example:<br>       if (condition) {<br>              single_statement();<br>   }<br><br>Another example:<br> if (condition) {<br>              single_statement();<br>   } else {<br>              another_single_statement();<br>   }<br><br>This is not something we would care about in code review either from<br>what I've seen and so it's probably just annoying for patch authors to<br>fix up.<br><br>Related: OS#5087<br>Change-Id: Ice08d5b88c683a59bacff999a1d6c07754663d39<br>---<br>M lint/checkpatch/checkpatch.pl<br>M lint/checkpatch/checkpatch_osmo.sh<br>2 files changed, 4 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/lint/checkpatch/checkpatch.pl b/lint/checkpatch/checkpatch.pl</span><br><span>index e31a61f..a4d229c 100755</span><br><span>--- a/lint/checkpatch/checkpatch.pl</span><br><span>+++ b/lint/checkpatch/checkpatch.pl</span><br><span>@@ -6008,7 +6008,7 @@</span><br><span>                                           $sum_allowed += $_;</span><br><span>                                  }</span><br><span>                                    if ($sum_allowed == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                                WARN("BRACES",</span><br><span style="color: hsl(120, 100%, 40%);">+                                              WARN("BRACES_NOT_NECESSARY", # Osmocom specific: renamed from BRACES</span><br><span>                                                    "braces {} are not necessary for any arm of this statement\n" . $herectx);</span><br><span>                                    } elsif ($sum_allowed != $allow &&</span><br><span>                                            $seen != $allow) {</span><br><span>@@ -6064,7 +6064,7 @@</span><br><span>                          my $cnt = statement_rawlines($block);</span><br><span>                                my $herectx = get_stat_here($linenr, $cnt, $here);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-                          WARN("BRACES",</span><br><span style="color: hsl(120, 100%, 40%);">+                              WARN("BRACES_NOT_NECESSARY", # Osmocom specific: renamed from BRACES</span><br><span>                                    "braces {} are not necessary for single statement blocks\n" . $herectx);</span><br><span>                      }</span><br><span>            }</span><br><span>diff --git a/lint/checkpatch/checkpatch_osmo.sh b/lint/checkpatch/checkpatch_osmo.sh</span><br><span>index ae66e71..d1ce63a 100755</span><br><span>--- a/lint/checkpatch/checkpatch_osmo.sh</span><br><span>+++ b/lint/checkpatch/checkpatch_osmo.sh</span><br><span>@@ -49,6 +49,7 @@</span><br><span> # * ASSIGN_IN_IF: not followed (e.g. 'if ((u8 = gsup_msg->cause))')</span><br><span> # * AVOID_EXTERNS: we do use externs</span><br><span> # * BLOCK_COMMENT_STYLE: we don't use a trailing */ on a separate line</span><br><span style="color: hsl(120, 100%, 40%);">+# * BRACES_NOT_NECESSARY: not followed</span><br><span> # * COMPLEX_MACRO: we don't use parentheses when building macros of strings across multiple lines</span><br><span> # * CONSTANT_COMPARISON: not followed: "Comparisons should place the constant on the right side"</span><br><span> # * DEEP_INDENTATION: warns about many leading tabs, not useful if changing existing code without refactoring</span><br><span>@@ -84,6 +85,7 @@</span><br><span>       --ignore ASSIGN_IN_IF \</span><br><span>      --ignore AVOID_EXTERNS \</span><br><span>     --ignore BLOCK_COMMENT_STYLE \</span><br><span style="color: hsl(120, 100%, 40%);">+        --ignore BRACES_NOT_NECESSARY \</span><br><span>      --ignore COMPLEX_MACRO \</span><br><span>     --ignore CONSTANT_COMPARISON \</span><br><span>       --ignore DEEP_INDENTATION \</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ci/+/26465">change 26465</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-ci/+/26465"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ci </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ice08d5b88c683a59bacff999a1d6c07754663d39 </div>
<div style="display:none"> Gerrit-Change-Number: 26465 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>