005cd559faa0946350413beaa5101e21e2db3b79

In change Ia98b97f4cfe47dcd94bfa54f3dd7be13c8696532, the function 'reg_psd_2_eirp' is defined twice: 1)when WLAN_FEATURE_11BE defined 2)when WLAN_FEATURE_11BE is not defined. However, both the functions are same except that (2) has the following statement of 3 lines(marked by lines beginning with '>>'): >>case BW_320_MHZ: >>ten_log_bw = 25; /* 10* 2.50514 = 25.0514 */ >>break; and (1) does not have the 3 lines. Both the functions require identical updates for their the common part. However, it is very likely to miss updating one function and update the other function. Or do different updates for the common part. Similarly for the non-common part, the function that does not need the non-common part also may get updated. Therefore, having multiple identical function bodies for the same function under conditional compilation is not a good design choice. Convert the mapping (psd+bw -> eirp) done through 'switch case' into a linear search through a lookup table. Refactor the code so that there is only one function body and the non-common part moves to the lookup table under the conditional compilation. Change-Id: Ic2c6e7dff5a2fed9d1c6624b042d2be023cafcfc CRs-Fixed: 3005569
This is CNSS WLAN Host Driver for products starting from iHelium
Omschrijving
Languages
C
98.7%
C++
0.9%
Makefile
0.3%
Starlark
0.1%