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

Remove unnecessary static cast #12751

Merged
merged 1 commit into from
Dec 9, 2021

Conversation

jmartinez-silabs
Copy link
Member

Problem

Remnant from a previous implementation.

otDeviceRole role = otThreadGetDeviceRole(mOTInst);
err               = encoder.Encode(static_cast<uint8_t>(role));

Where otDeviceRole had to cast to a uint8_t . Now that is correctly mapped to ThreadNetworkDiagnostics::RoutingRole, it doesn’t have to be casted

Change overview

Remove unnecessary cast as it could cause problems as code and spec evolves

Testing

Minimal change, just validated that it builds.

@github-actions
Copy link

github-actions bot commented Dec 8, 2021

PR #12751: Size comparison from e4f3246 to bdf4ed8

Increases (3 builds for efr32)
platform target config section e4f3246 bdf4ed8 change % change
efr32 lighting-app BRD4161A (read only) 803900 803916 16 0.0
.text 803892 803908 16 0.0
BRD4161A+rpc (read only) 791512 791528 16 0.0
.text 791504 791520 16 0.0
window-app BRD4161A (read only) 780852 780868 16 0.0
.text 780844 780860 16 0.0
Full report (30 builds for efr32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section e4f3246 bdf4ed8 change % change
efr32 lighting-app BRD4161A (read only) 803900 803916 16 0.0
(read/write) 122996 122996 0 0.0
.bss 121176 121176 0 0.0
.data 1820 1820 0 0.0
.text 803892 803908 16 0.0
BRD4161A+rpc (read only) 791512 791528 16 0.0
(read/write) 139680 139680 0 0.0
.bss 137752 137752 0 0.0
.data 1928 1928 0 0.0
.text 791504 791520 16 0.0
window-app BRD4161A (read only) 780852 780868 16 0.0
(read/write) 121136 121136 0 0.0
.bss 119352 119352 0 0.0
.data 1784 1784 0 0.0
.text 780844 780860 16 0.0
k32w lighting-app k32w061+se05x+release (read/write) 724516 724516 0 0.0
.bss 81248 81248 0 0.0
.data 1852 1852 0 0.0
.text 635616 635616 0 0.0
lock-app k32w061+debug (read/write) 615868 615868 0 0.0
.bss 71912 71912 0 0.0
.data 1820 1820 0 0.0
.text 536336 536336 0 0.0
shell k32w061+debug (read/write) 679124 679124 0 0.0
.bss 81612 81612 0 0.0
.data 1792 1792 0 0.0
.text 589920 589920 0 0.0
linux chip-tool-ipv6only arm64 (read only) 6732084 6732084 0 0.0
(read/write) 310977 310977 0 0.0
.bss 51665 51665 0 0.0
.data 1048 1048 0 0.0
.data.rel.ro 206592 206592 0 0.0
.dynamic 560 560 0 0.0
.got 48040 48040 0 0.0
.init 24 24 0 0.0
.init_array 160 160 0 0.0
.rodata 341796 341796 0 0.0
.text 5731988 5731988 0 0.0
thermostat-no-ble arm64 (read only) 1932044 1932044 0 0.0
(read/write) 136465 136465 0 0.0
.bss 59457 59457 0 0.0
.data 776 776 0 0.0
.data.rel.ro 69840 69840 0 0.0
.dynamic 560 560 0 0.0
.got 3528 3528 0 0.0
.init 24 24 0 0.0
.init_array 256 256 0 0.0
.rodata 124988 124988 0 0.0
.text 1601088 1601088 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2319536 2319536 0 0.0
.bss 186900 186900 0 0.0
.data 5232 5232 0 0.0
.heap 844312 844312 0 0.0
.text 1282112 1282112 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2305736 2305736 0 0.0
.bss 175712 175712 0 0.0
.data 5488 5488 0 0.0
.heap 855248 855248 0 0.0
.text 1268336 1268336 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2278720 2278720 0 0.0
.bss 174752 174752 0 0.0
.data 5488 5488 0 0.0
.heap 856208 856208 0 0.0
.text 1241320 1241320 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1140008 1140008 0 0.0
.bss 11756 11756 0 0.0
.data 4376 4376 0 0.0
.heap 1020312 1020312 0 0.0
.text 103392 103392 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2047808 2047808 0 0.0
.bss 156564 156564 0 0.0
.data 4864 4864 0 0.0
.heap 875016 875016 0 0.0
.text 1010408 1010408 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 903055 903055 0 0.0
bss 116184 116184 0 0.0
rodata 101208 101208 0 0.0
text 610104 610104 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 866079 866079 0 0.0
bss 112532 112532 0 0.0
rodata 92504 92504 0 0.0
text 584832 584832 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 829046 829046 0 0.0
bss 117560 117560 0 0.0
rodata 96464 96464 0 0.0
text 540532 540532 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 875523 875523 0 0.0
bss 113448 113448 0 0.0
rodata 97324 97324 0 0.0
text 589364 589364 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 801754 801754 0 0.0
bss 114856 114856 0 0.0
rodata 92612 92612 0 0.0
text 519884 519884 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497463 497463 0 0.0
bss 51820 51820 0 0.0
rodata 45852 45852 0 0.0
text 339492 339492 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 880371 880371 0 0.0
bss 113360 113360 0 0.0
rodata 98676 98676 0 0.0
text 592880 592880 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 873599 873599 0 0.0
bss 113236 113236 0 0.0
rodata 96816 96816 0 0.0
text 588100 588100 0 0.0
shell nrf52840dk_nrf52840 (read/write) 781611 781611 0 0.0
bss 109552 109552 0 0.0
rodata 74280 74280 0 0.0
text 523264 523264 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 696686 696686 0 0.0
bss 110532 110532 0 0.0
rodata 68920 68920 0 0.0
text 443904 443904 0 0.0
p6 all-clusters-app default (read/write) 2355624 2355624 0 0.0
.bss 113132 113132 0 0.0
.data 2512 2512 0 0.0
.heap 917696 917696 0 0.0
.text 1313888 1313888 0 0.0
light-app default (read/write) 2290408 2290408 0 0.0
.bss 100904 100904 0 0.0
.data 2328 2328 0 0.0
.heap 930112 930112 0 0.0
.text 1248672 1248672 0 0.0
lock-app default (read/write) 2266512 2266512 0 0.0
.bss 99784 99784 0 0.0
.data 2288 2288 0 0.0
.heap 931272 931272 0 0.0
.text 1224776 1224776 0 0.0
qpg lighting-app qpg6100+debug (read only) 517744 517744 0 0.0
(read/write) 122332 122332 0 0.0
.bss 82624 82624 0 0.0
.data 956 956 0 0.0
.text 512424 512424 0 0.0
lock-app qpg6100+debug (read only) 491944 491944 0 0.0
(read/write) 122336 122336 0 0.0
.bss 81760 81760 0 0.0
.data 912 912 0 0.0
.text 486624 486624 0 0.0
persistent-storage-app qpg6100+debug (read only) 108104 108104 0 0.0
(read/write) 122336 122336 0 0.0
.bss 36152 36152 0 0.0
.data 288 288 0 0.0
.text 102784 102784 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 807090 807090 0 0.0
bss 82764 82764 0 0.0
noinit 37160 37160 0 0.0
text 563090 563090 0 0.0

@woody-apple woody-apple merged commit 1423df5 into project-chip:master Dec 9, 2021
@jmartinez-silabs jmartinez-silabs deleted the remove_cast branch December 9, 2021 14:43
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.

5 participants