summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Eckelmann2025-11-23 14:17:52 +0000
committerHauke Mehrtens2025-11-24 23:28:50 +0000
commit69c6658c73113163bd3680db60ed45433f9fe15f (patch)
tree0df1a3db36b5cc83f0c24a284f908f9e4e7ae31d
parent80375e5acdaaf7555cd44ee1c8f247f701c6c5cb (diff)
downloadopenwrt-69c6658c73113163bd3680db60ed45433f9fe15f.tar.gz
realtek: pcs: Reduce nesting during calibration
It is preferred in the kernel to have less nesting of scopes. More common is to perform pre-condition checks (like error handlers) and then react to them. Signed-off-by: Sven Eckelmann <sven@narfation.org> Link: https://github.com/openwrt/openwrt/pull/20906 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 200475d56b..cced6d5168 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -1259,18 +1259,17 @@ static void rtpcs_930x_sds_do_rx_calibration_2_3(struct rtpcs_ctrl *ctrl,
offset_range = rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x15, 15, 14);
- if (fgcal_binary > 60 || fgcal_binary < 3) {
- if (offset_range == 3) {
- pr_info("%s: Foreground Calibration result marginal!", __func__);
- break;
- } else {
- offset_range++;
- rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x15, 15, 14, offset_range);
- rtpcs_930x_sds_do_rx_calibration_2_2(ctrl, sds_num);
- }
- } else {
+ if (fgcal_binary <= 60 && fgcal_binary >= 3)
+ break;
+
+ if (offset_range == 3) {
+ pr_info("%s: Foreground Calibration result marginal!", __func__);
break;
}
+
+ offset_range++;
+ rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x15, 15, 14, offset_range);
+ rtpcs_930x_sds_do_rx_calibration_2_2(ctrl, sds_num);
}
pr_info("%s: end_1.2.3\n", __func__);
}