mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 18:42:29 +03:00
Reduce code complexity of following functions in gr.ecc unit gp10b_ecc_init(complexity : 17) gp10b_ecc_detect_enabled_units(complexity : 15) gv11b_ecc_init(complexity : 23) gv11b_ecc_detect_enabled_units(complexity : 30) Create sub functions by moving the control statement codes from the function which has high complexity above 10. Create four sub functions from gp10b_ecc_init function for sub units init. gp10b_ecc_init_lts(complexity : 2) gp10b_ecc_init_tpc(complexity : 2) gp10b_ecc_init_tpc_tex(complexity : 8) gp10b_ecc_init_tpc_sm(complexity : 5) and reduce gp10b_ecc_init complexity to 3 Create four sub functions from gp10b_ecc_detect_enabled_units function gp10b_ecc_enable_ltc(with complexity : 4) gp10b_ecc_enable_tex(with complexity : 4) gp10b_ecc_enable_smshm(with complexity : 4) gp10b_ecc_enable_smlrf(with complexity : 4) and reduce gp10b_ecc_detect_enabled_units complexity to 3 Create four sub functions from gv11b_ecc_init function for sub units init. gv11b_ecc_init_tpc(complexity : 10) gv11b_ecc_init_gpc(complexity : 6) gv11b_ecc_init_fb(complexity : 6) gv11b_ecc_init_other_units(complexity : 6) and reduce gv11b_ecc_init complexity to 5 Create six sub functions from gv11b_ecc_detect_enabled_units function gv11b_ecc_enable_smlrf(with complexity : 4) gv11b_ecc_enable_sml1data(with complexity : 4) gv11b_ecc_enable_sml1tag(with complexity : 4) gv11b_ecc_enable_smicache(with complexity : 6) gv11b_ecc_enable_ltc(with complexity : 4) gv11b_ecc_enable_smcbu(with complexity : 4) and reduce gv11b_ecc_detect_enabled_units complexity to 3 Jira NVGPU-3662 Change-Id: Id10be4f9a500c300f66756ebae41bfff3b734aea Signed-off-by: Vinod G <vinodg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2159050 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>