Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang-tidy readability-else-after-return #16312

Merged

Conversation

andy31415
Copy link
Contributor

Problem

else when not needed increases indent level. Clang can fix that

Change overview

Ran:

./.environment/cipd/packages/pigweed/bin/run-clang-tidy -p ./out/linux-x64-chip-tool-clang/ -fix -checks readability-else-after-return 'connectedhomeip/src/'

Testing

Automated tool run. Visually inspecting changes looked ok. CI will validate run/compilation.

@github-actions
Copy link

github-actions bot commented Mar 16, 2022

PR #16312: Size comparison from 645b03b to 3f02d22

Increases (1 build for esp32)
platform target config section 645b03b 3f02d22 change % change
esp32 all-clusters-app c3devkit (read only) 961162 961194 32 0.0
.flash.text 961162 961194 32 0.0
Decreases (3 builds for esp32, linux)
platform target config section 645b03b 3f02d22 change % change
esp32 all-clusters-app m5stack (read only) 1017251 1017239 -12 -0.0
.flash.text 1011867 1011855 -12 -0.0
linux chip-tool-ipv6only arm64 (read only) 9754132 9754068 -64 -0.0
.text 8211892 8211828 -64 -0.0
thermostat-no-ble arm64 (read only) 2219868 2219788 -80 -0.0
.text 1862240 1862160 -80 -0.0
Full report (27 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 645b03b 3f02d22 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 603282 603282 0 0.0
.app_xip_area 510380 510380 0 0.0
.bss 75656 75656 0 0.0
.data 596 596 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 561070 561070 0 0.0
.app_xip_area 469696 469696 0 0.0
.bss 74160 74160 0 0.0
.data 560 560 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 570954 570954 0 0.0
.app_xip_area 469932 469932 0 0.0
.bss 83464 83464 0 0.0
.data 520 520 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 920740 920740 0 0.0
(read/write) 128752 128752 0 0.0
.bss 126744 126744 0 0.0
.data 2008 2008 0 0.0
.text 920732 920732 0 0.0
BRD4161A+rpc (read only) 949544 949544 0 0.0
(read/write) 144712 144712 0 0.0
.bss 142520 142520 0 0.0
.data 2188 2188 0 0.0
.text 949536 949536 0 0.0
window-app BRD4161A (read only) 851488 851488 0 0.0
(read/write) 126712 126712 0 0.0
.bss 124848 124848 0 0.0
.data 1864 1864 0 0.0
.text 851480 851480 0 0.0
esp32 all-clusters-app c3devkit (read only) 961162 961194 32 0.0
(read/write) 1394690 1394690 0 0.0
.dram0.bss 64048 64048 0 0.0
.dram0.data 14188 14188 0 0.0
.flash.rodata 197544 197544 0 0.0
.flash.text 961162 961194 32 0.0
.iram0.text 62016 62016 0 0.0
m5stack (read only) 1017251 1017239 -12 -0.0
(read/write) 462364 462364 0 0.0
.dram0.bss 69576 69576 0 0.0
.dram0.data 34016 34016 0 0.0
.flash.rodata 226936 226936 0 0.0
.flash.text 1011867 1011855 -12 -0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 699960 699960 0 0.0
.bss 77632 77632 0 0.0
.data 1888 1888 0 0.0
.text 614640 614640 0 0.0
lock k32w061+release (read/write) 700256 700256 0 0.0
.bss 77624 77624 0 0.0
.data 1908 1908 0 0.0
.text 614924 614924 0 0.0
linux all-clusters-app debug (read only) 2471121 2471121 0 0.0
(read/write) 146544 146544 0 0.0
.bss 60736 60736 0 0.0
.data 1264 1264 0 0.0
.data.rel.ro 78808 78808 0 0.0
.dynamic 592 592 0 0.0
.got 4168 4168 0 0.0
.init 27 27 0 0.0
.init_array 936 936 0 0.0
.rodata 210853 210853 0 0.0
.text 2096914 2096914 0 0.0
bridge-app debug+rpc (read only) 1747453 1747453 0 0.0
(read/write) 92720 92720 0 0.0
.bss 47784 47784 0 0.0
.data 1952 1952 0 0.0
.data.rel.ro 37904 37904 0 0.0
.dynamic 592 592 0 0.0
.got 3920 3920 0 0.0
.init 27 27 0 0.0
.init_array 544 544 0 0.0
.rodata 143564 143564 0 0.0
.text 1488773 1488773 0 0.0
chip-tool debug (read only) 10127373 10127373 0 0.0
(read/write) 357720 357720 0 0.0
.bss 25728 25728 0 0.0
.data 1072 1072 0 0.0
.data.rel.ro 324864 324864 0 0.0
.dynamic 608 608 0 0.0
.got 4784 4784 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 515669 515669 0 0.0
.text 8830373 8830373 0 0.0
chip-tool-ipv6only arm64 (read only) 9754132 9754068 -64 -0.0
(read/write) 475473 475473 0 0.0
.bss 44033 44033 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 371256 371256 0 0.0
.dynamic 560 560 0 0.0
.got 55264 55264 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 492348 492348 0 0.0
.text 8211892 8211828 -64 -0.0
door-lock-app debug (read only) 1998585 1998585 0 0.0
(read/write) 120192 120192 0 0.0
.bss 51008 51008 0 0.0
.data 992 992 0 0.0
.data.rel.ro 62808 62808 0 0.0
.dynamic 592 592 0 0.0
.got 4120 4120 0 0.0
.init 27 27 0 0.0
.init_array 664 664 0 0.0
.rodata 179740 179740 0 0.0
.text 1669282 1669282 0 0.0
lighting-app debug+rpc (read only) 2130201 2130201 0 0.0
(read/write) 125512 125512 0 0.0
.bss 51776 51776 0 0.0
.data 1472 1472 0 0.0
.data.rel.ro 66760 66760 0 0.0
.dynamic 608 608 0 0.0
.got 4152 4152 0 0.0
.init 27 27 0 0.0
.init_array 736 736 0 0.0
.rodata 172316 172316 0 0.0
.text 1801298 1801298 0 0.0
ota-provider-app debug (read only) 1933633 1933633 0 0.0
(read/write) 116016 116016 0 0.0
.bss 50912 50912 0 0.0
.data 1288 1288 0 0.0
.data.rel.ro 58168 58168 0 0.0
.dynamic 608 608 0 0.0
.got 4376 4376 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 165739 165739 0 0.0
.text 1616226 1616226 0 0.0
ota-requestor-app debug (read only) 1963417 1963417 0 0.0
(read/write) 118984 118984 0 0.0
.bss 51904 51904 0 0.0
.data 1416 1416 0 0.0
.data.rel.ro 60232 60232 0 0.0
.dynamic 592 592 0 0.0
.got 4168 4168 0 0.0
.init 27 27 0 0.0
.init_array 640 640 0 0.0
.rodata 161764 161764 0 0.0
.text 1649762 1649762 0 0.0
shell debug (read only) 2421345 2421345 0 0.0
(read/write) 150600 150600 0 0.0
.bss 70664 70664 0 0.0
.data 784 784 0 0.0
.data.rel.ro 73440 73440 0 0.0
.dynamic 592 592 0 0.0
.got 4152 4152 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 208850 208850 0 0.0
.text 2055890 2055890 0 0.0
thermostat-no-ble arm64 (read only) 2219868 2219788 -80 -0.0
(read/write) 149777 149777 0 0.0
.bss 65713 65713 0 0.0
.data 1024 1024 0 0.0
.data.rel.ro 75696 75696 0 0.0
.dynamic 560 560 0 0.0
.got 4352 4352 0 0.0
.init 24 24 0 0.0
.init_array 360 360 0 0.0
.rodata 137660 137660 0 0.0
.text 1862240 1862160 -80 -0.0
tv-app debug (read only) 2669889 2669889 0 0.0
(read/write) 251192 251192 0 0.0
.bss 167904 167904 0 0.0
.data 3104 3104 0 0.0
.data.rel.ro 74152 74152 0 0.0
.dynamic 592 592 0 0.0
.got 4552 4552 0 0.0
.init 27 27 0 0.0
.init_array 880 880 0 0.0
.rodata 205621 205621 0 0.0
.text 2289538 2289538 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2352172 2352172 0 0.0
.bss 186644 186644 0 0.0
.data 5752 5752 0 0.0
.text 1314772 1314772 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1154647 1154647 0 0.0
bss 146724 146724 0 0.0
rodata 145432 145432 0 0.0
text 787340 787340 0 0.0
p6 all-clusters-app default (read/write) 2491392 2491392 0 0.0
.bss 120072 120072 0 0.0
.data 2632 2632 0 0.0
.text 1449656 1449656 0 0.0
light-app default (read/write) 2395248 2395248 0 0.0
.bss 113536 113536 0 0.0
.data 2488 2488 0 0.0
.text 1353512 1353512 0 0.0
lock-app default (read/write) 2358792 2358792 0 0.0
.bss 113280 113280 0 0.0
.data 2448 2448 0 0.0
.text 1317056 1317056 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 894566 894566 0 0.0
bss 87432 87432 0 0.0
noinit 37160 37160 0 0.0
text 632492 632492 0 0.0

@andy31415 andy31415 merged commit 0c43841 into project-chip:master Mar 16, 2022
andrei-menzopol pushed a commit to andrei-menzopol/connectedhomeip that referenced this pull request Apr 14, 2022
* use clang-tidy to readability-else-after-return

* Restyle

* Ran a 2nd pass

* Restyle

* Ran a 2nd pass

* Restyle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants