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-redundant-* #17121

Merged

Conversation

andy31415
Copy link
Contributor

Problem

Redundant code hurts readability/maintenance, clang-tidy can fix things up.

Change overview

enabled readability-redundant-* in .clang-tidy then ran

./scripts/run-clang-tidy-on-compile-commands.py --compile-database out/linux-x64-tests/compile_commands.json fix

Removed an extra comment from a duplicated af.h declaration and reverted changes in zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h since I did not want to update zap templates just yet.

Reverted the .clang-tidy change, only kept fixes for review. Will change clang-tidy once we fix CHIPClustersTest.h as well

Testing

Code should still compile, changes were made by an automated tool.

@github-actions
Copy link

github-actions bot commented Apr 6, 2022

PR #17121: Size comparison from cd29bba to 7496aaf

Increases (1 build for linux)
platform target config section cd29bba 7496aaf change % change
linux chip-tool-no-interactive-ipv6only arm64 (read only) 10278220 10278236 16 0.0
.text 8663044 8663060 16 0.0
Decreases (1 build for linux)
platform target config section cd29bba 7496aaf change % change
linux thermostat-no-ble arm64 (read only) 2344188 2344172 -16 -0.0
.text 1972672 1972656 -16 -0.0
Full report (2 builds for linux)
platform target config section cd29bba 7496aaf change % change
linux chip-tool-no-interactive-ipv6only arm64 (read only) 10278220 10278236 16 0.0
(read/write) 492033 492033 0 0.0
.bss 41041 41041 0 0.0
.data 1120 1120 0 0.0
.data.rel.ro 388704 388704 0 0.0
.dynamic 560 560 0 0.0
.got 57360 57360 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 512396 512396 0 0.0
.text 8663044 8663060 16 0.0
thermostat-no-ble arm64 (read only) 2344188 2344172 -16 -0.0
(read/write) 150257 150257 0 0.0
.bss 63169 63169 0 0.0
.data 1136 1136 0 0.0
.data.rel.ro 78184 78184 0 0.0
.dynamic 560 560 0 0.0
.got 4752 4752 0 0.0
.init 24 24 0 0.0
.init_array 368 368 0 0.0
.rodata 144364 144364 0 0.0
.text 1972672 1972656 -16 -0.0

@github-actions
Copy link

github-actions bot commented Apr 6, 2022

PR #17121: Size comparison from cd29bba to 7d8881e

Increases above 0.2%:

platform target config section cd29bba 7d8881e change % change
efr32 lighting-app BRD4161A (read/write) 129580 133144 3564 2.8
.bss 127584 131152 3568 2.8
BRD4161A+rpc (read/write) 145528 149092 3564 2.4
.bss 143352 146920 3568 2.5
window-app BRD4161A (read/write) 127640 131204 3564 2.8
.bss 125760 129328 3568 2.8
Increases (4 builds for efr32, linux)
platform target config section cd29bba 7d8881e change % change
efr32 lighting-app BRD4161A (read/write) 129580 133144 3564 2.8
.bss 127584 131152 3568 2.8
BRD4161A+rpc (read/write) 145528 149092 3564 2.4
.bss 143352 146920 3568 2.5
window-app BRD4161A (read/write) 127640 131204 3564 2.8
.bss 125760 129328 3568 2.8
linux chip-tool-no-interactive-ipv6only arm64 (read only) 10278220 10278236 16 0.0
.text 8663044 8663060 16 0.0
Decreases (5 builds for efr32, linux)
platform target config section cd29bba 7d8881e change % change
efr32 lighting-app BRD4161A (read only) 923476 904532 -18944 -2.1
.data 1996 1992 -4 -0.2
.text 923468 904524 -18944 -2.1
BRD4161A+rpc (read only) 951364 932420 -18944 -2.0
.data 2176 2172 -4 -0.2
.text 951356 932412 -18944 -2.0
window-app BRD4161A (read only) 860796 841868 -18928 -2.2
.data 1880 1876 -4 -0.2
.text 860788 841860 -18928 -2.2
linux chip-tool debug (read only) 10675813 1067571 -96 -0.0
.text 9309013 9308917 -96 -0.0
thermostat-no-ble arm64 (read only) 2344188 2344172 -16 -0.0
.text 1972672 1972656 -16 -0.0
Full report (28 builds for cc13x2_26x2, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section cd29bba 7d8881e change % change
cc13x2_26x2 lock-ftd LP_CC2652R7 (read only) 674307 674307 0 0.0
(read/write) 177204 177204 0 0.0
.bss 81552 81552 0 0.0
.data 3168 3168 0 0.0
.rodata 80579 80579 0 0.0
.text 593248 593248 0 0.0
lock-mtd LP_CC2652R7 (read only) 623443 623443 0 0.0
(read/write) 154304 154304 0 0.0
.bss 77280 77280 0 0.0
.data 3168 3168 0 0.0
.rodata 80467 80467 0 0.0
.text 542488 542488 0 0.0
pump-app LP_CC2652R7 (read only) 691607 691607 0 0.0
(read/write) 161064 161064 0 0.0
.bss 81944 81944 0 0.0
.data 3200 3200 0 0.0
.rodata 82511 82511 0 0.0
.text 608612 608612 0 0.0
pump-controller-app LP_CC2652R7 (read only) 675979 675979 0 0.0
(read/write) 176436 176436 0 0.0
.bss 81688 81688 0 0.0
.data 3164 3164 0 0.0
.rodata 79011 79011 0 0.0
.text 596484 596484 0 0.0
efr32 lighting-app BRD4161A (read only) 923476 904532 -18944 -2.1
(read/write) 129580 133144 3564 2.8
.bss 127584 131152 3568 2.8
.data 1996 1992 -4 -0.2
.text 923468 904524 -18944 -2.1
BRD4161A+rpc (read only) 951364 932420 -18944 -2.0
(read/write) 145528 149092 3564 2.4
.bss 143352 146920 3568 2.5
.data 2176 2172 -4 -0.2
.text 951356 932412 -18944 -2.0
window-app BRD4161A (read only) 860796 841868 -18928 -2.2
(read/write) 127640 131204 3564 2.8
.bss 125760 129328 3568 2.8
.data 1880 1876 -4 -0.2
.text 860788 841860 -18928 -2.2
esp32 all-clusters-app c3devkit (read only) 991668 991668 0 0.0
(read/write) 1461530 1461530 0 0.0
.dram0.bss 63000 63000 0 0.0
.dram0.data 14260 14260 0 0.0
.flash.rodata 198784 198784 0 0.0
.flash.text 991668 991668 0 0.0
.iram0.text 62572 62572 0 0.0
m5stack (read only) 1043503 1043503 0 0.0
(read/write) 462488 462488 0 0.0
.dram0.bss 68528 68528 0 0.0
.dram0.data 34064 34064 0 0.0
.flash.rodata 227752 227752 0 0.0
.flash.text 1038119 1038119 0 0.0
.iram0.text 123415 123415 0 0.0
k32w light k32w061+release (read/write) 684828 684828 0 0.0
.bss 78240 78240 0 0.0
.data 1988 1988 0 0.0
.text 598800 598800 0 0.0
lock k32w061+release (read/write) 689668 689668 0 0.0
.bss 78816 78816 0 0.0
.data 1948 1948 0 0.0
.text 603104 603104 0 0.0
linux all-clusters-app debug (read only) 2617705 2617705 0 0.0
(read/write) 145384 145384 0 0.0
.bss 57856 57856 0 0.0
.data 1408 1408 0 0.0
.data.rel.ro 80232 80232 0 0.0
.dynamic 592 592 0 0.0
.got 4312 4312 0 0.0
.init 27 27 0 0.0
.init_array 960 960 0 0.0
.rodata 222149 222149 0 0.0
.text 2226866 2226866 0 0.0
bridge-app debug+rpc (read only) 1826845 1826845 0 0.0
(read/write) 90824 90824 0 0.0
.bss 44792 44792 0 0.0
.data 2048 2048 0 0.0
.data.rel.ro 38904 38904 0 0.0
.dynamic 592 592 0 0.0
.got 3928 3928 0 0.0
.init 27 27 0 0.0
.init_array 552 552 0 0.0
.rodata 148409 148409 0 0.0
.text 1561157 1561157 0 0.0
chip-tool debug (read only) 10675813 1067571 -96 -0.0
(read/write) 371640 371640 0 0.0
.bss 22784 22784 0 0.0
.data 1040 1040 0 0.0
.data.rel.ro 341584 341584 0 0.0
.dynamic 624 624 0 0.0
.got 4928 4928 0 0.0
.init 27 27 0 0.0
.init_array 656 656 0 0.0
.rodata 538005 538005 0 0.0
.text 9309013 9308917 -96 -0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 10278220 10278236 16 0.0
(read/write) 492033 492033 0 0.0
.bss 41041 41041 0 0.0
.data 1120 1120 0 0.0
.data.rel.ro 388704 388704 0 0.0
.dynamic 560 560 0 0.0
.got 57360 57360 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 512396 512396 0 0.0
.text 8663044 8663060 16 0.0
door-lock-app debug (read only) 2098057 2098057 0 0.0
(read/write) 118864 118864 0 0.0
.bss 48128 48128 0 0.0
.data 1152 1152 0 0.0
.data.rel.ro 64024 64024 0 0.0
.dynamic 592 592 0 0.0
.got 4256 4256 0 0.0
.init 27 27 0 0.0
.init_array 680 680 0 0.0
.rodata 186441 186441 0 0.0
.text 1757154 1757154 0 0.0
lighting-app debug+rpc (read only) 2277625 2277625 0 0.0
(read/write) 125920 125920 0 0.0
.bss 49472 49472 0 0.0
.data 1600 1600 0 0.0
.data.rel.ro 69160 69160 0 0.0
.dynamic 608 608 0 0.0
.got 4304 4304 0 0.0
.init 27 27 0 0.0
.init_array 760 760 0 0.0
.rodata 180553 180553 0 0.0
.text 1933122 1933122 0 0.0
ota-provider-app debug (read only) 2036033 2036033 0 0.0
(read/write) 114432 114432 0 0.0
.bss 47968 47968 0 0.0
.data 1384 1384 0 0.0
.data.rel.ro 59352 59352 0 0.0
.dynamic 608 608 0 0.0
.got 4456 4456 0 0.0
.init 27 27 0 0.0
.init_array 632 632 0 0.0
.rodata 172291 172291 0 0.0
.text 1708370 1708370 0 0.0
ota-requestor-app debug (read only) 2065617 2065617 0 0.0
(read/write) 117720 117720 0 0.0
.bss 48928 48928 0 0.0
.data 1608 1608 0 0.0
.data.rel.ro 61592 61592 0 0.0
.dynamic 592 592 0 0.0
.got 4296 4296 0 0.0
.init 27 27 0 0.0
.init_array 656 656 0 0.0
.rodata 168820 168820 0 0.0
.text 1739650 1739650 0 0.0
shell debug (read only) 2513177 2513177 0 0.0
(read/write) 148912 148912 0 0.0
.bss 67560 67560 0 0.0
.data 848 848 0 0.0
.data.rel.ro 74776 74776 0 0.0
.dynamic 592 592 0 0.0
.got 4160 4160 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 213874 213874 0 0.0
.text 2140098 2140098 0 0.0
thermostat-no-ble arm64 (read only) 2344188 2344172 -16 -0.0
(read/write) 150257 150257 0 0.0
.bss 63169 63169 0 0.0
.data 1136 1136 0 0.0
.data.rel.ro 78184 78184 0 0.0
.dynamic 560 560 0 0.0
.got 4752 4752 0 0.0
.init 24 24 0 0.0
.init_array 368 368 0 0.0
.rodata 144364 144364 0 0.0
.text 1972672 1972656 -16 -0.0
tv-app debug (read only) 2787361 2787361 0 0.0
(read/write) 250488 250488 0 0.0
.bss 165576 165576 0 0.0
.data 3360 3360 0 0.0
.data.rel.ro 75360 75360 0 0.0
.dynamic 592 592 0 0.0
.got 4672 4672 0 0.0
.init 27 27 0 0.0
.init_array 904 904 0 0.0
.rodata 212523 212523 0 0.0
.text 2395362 2395362 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2366580 2366580 0 0.0
.bss 185092 185092 0 0.0
.data 5792 5792 0 0.0
.text 1329180 1329180 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1152967 1152967 0 0.0
bss 135604 135604 0 0.0
rodata 145632 145632 0 0.0
text 793156 793156 0 0.0
p6 all-clusters-app default (read/write) 2511992 2511992 0 0.0
.bss 118528 118528 0 0.0
.data 2672 2672 0 0.0
.text 1470256 1470256 0 0.0
light-app default (read/write) 2413168 2413168 0 0.0
.bss 111992 111992 0 0.0
.data 2528 2528 0 0.0
.text 1371432 1371432 0 0.0
lock-app default (read/write) 2376848 2376848 0 0.0
.bss 111736 111736 0 0.0
.data 2488 2488 0 0.0
.text 1335112 1335112 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 798836 798836 0 0.0
bss 70096 70096 0 0.0
noinit 40416 40416 0 0.0
text 567918 567918 0 0.0

@andy31415 andy31415 merged commit 0c06ba5 into project-chip:master Apr 7, 2022
andrei-menzopol pushed a commit to andrei-menzopol/connectedhomeip that referenced this pull request Apr 14, 2022
* Ran clang-tidy using readability-redundant-*

* Restyle

* Add back session holder init: it looks like -Wextra is more strict on what calls should be made on base classes
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.

4 participants