linux/drivers/staging/vt6656
Oscar Carter 69a809e156 staging: vt6656: Refactor the vnt_update_pre_ed_threshold function
Create three arrays with the threshold data use in the switch statement
of the vnt_update_pre_ed_threshold function. These three arrays contains
elements of struct vnt_threshold new type.

Create a for loop in the vnt_update_pre_ed_threshold function to do
exactly the same that the if-elseif-else statements in the switch
statement.

Also, remove the if check against the !cr_201 && !cr_206 due to now it
is replace by the NULL check against the threshold pointer. When this
pointer is NULL means that the cr_201 and cr_206 variables have not been
assigned, that is the same that the old comparison against cr_201 and
cr_206 due to these variables were initialized with 0.

The statistics of the old baseband object file are:

section              size   addr
.text                3415      0
.data                 576      0
.bss                    0      0
.rodata               120      0
.comment               45      0
.note.GNU-stack         0      0
.note.gnu.property     28      0
Total                4184

The statistics of the new baseband object file are:

section              size   addr
.text                2209      0
.data                 576      0
.bss                    0      0
.rodata               344      0
.comment               45      0
.note.GNU-stack         0      0
.note.gnu.property     28      0
Total                3202

With this refactoring it increase a little the readonly data but it
decrease much more the .text section. This refactoring decrease the
footprint and makes the code more clear.

Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Reviewed-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk>
Link: https://lore.kernel.org/r/20200328181706.14276-1-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:27 +02:00
..
baseband.c staging: vt6656: Refactor the vnt_update_pre_ed_threshold function 2020-04-13 08:55:27 +02:00
baseband.h staging: vt6656: avoid discarding called function's return code 2019-05-21 08:25:03 +02:00
card.c staging: vt6656: Use BIT() macro in vnt_mac_reg_bits_* functions 2020-03-21 11:03:16 +01:00
card.h staging: vt6656: Fix styling of the comment related to SPDX-License-Identifier 2019-04-02 09:29:27 +02:00
channel.c staging: vt6656: Remove redundant license text 2017-11-28 13:20:47 +01:00
channel.h staging: vt6656: Fix styling of the comment related to SPDX-License-Identifier 2019-04-02 09:29:27 +02:00
desc.h staging: vt6656: Use BIT() macro instead of hex value 2020-03-21 10:58:16 +01:00
device.h staging: vt6656: Use BIT() macro instead of hex value 2020-03-21 10:58:16 +01:00
firmware.c staging: vt6656: Remove memory buffer from vnt_download_firmware. 2020-01-22 09:52:39 +01:00
firmware.h staging: vt6656: Fix styling of the comment related to SPDX-License-Identifier 2019-04-02 09:29:27 +02:00
Kconfig staging: vt665*: use help instead of ---help--- in Kconfig 2019-05-20 10:49:08 +02:00
key.c staging: vt6656: Fix return for unsupported cipher modes. 2020-02-09 16:22:56 -08:00
key.h staging: vt6656: Fix styling of the comment related to SPDX-License-Identifier 2019-04-02 09:29:27 +02:00
mac.c staging: vt6656: avoid discarding called function's return code 2019-05-21 08:25:03 +02:00
mac.h staging: vt6656: Use BIT() macro instead of hex value 2020-03-21 10:58:16 +01:00
main_usb.c staging: vt6656: Use defines in preamble_type variables 2020-04-13 08:55:27 +02:00
Makefile staging: vt6656: Move vnt_rx_data to usbpipe.c 2020-03-04 07:54:09 +01:00
power.c staging: vt6656: Remove redundant license text 2017-11-28 13:20:47 +01:00
power.h staging: vt6656: Fix styling of the comment related to SPDX-License-Identifier 2019-04-02 09:29:27 +02:00
rf.c staging: vt6656: avoid discarding called function's return code 2019-05-21 08:25:03 +02:00
rf.h staging: vt6656: avoid discarding called function's return code 2019-05-21 08:25:03 +02:00
rxtx.c staging: vt6656: Remove STATUS enums from TX path 2020-03-04 07:52:31 +01:00
rxtx.h staging: vt6656: remove blank line 2020-03-10 10:15:21 +01:00
TODO
usbpipe.c staging: vt6656: struct vnt_rcb remove unused in_use. 2020-03-10 10:51:20 +01:00
usbpipe.h staging: vt6656: Delete int.c/h file and move functions to usbpipe 2020-03-04 07:52:32 +01:00
wcmd.c staging: vt6656: set usb_set_intfdata on driver fail. 2020-01-03 11:46:59 +01:00
wcmd.h staging: vt6656: Fix styling of the comment related to SPDX-License-Identifier 2019-04-02 09:29:27 +02:00