[PATCH next RFC 4/5] ram: rk3399: merge two consecutive ifs with same condition
Quentin Schulz
foss+uboot at 0leil.net
Tue Nov 5 18:21:58 CET 2024
From: Quentin Schulz <quentin.schulz at cherry.de>
Nothing changes channel_mask in the first if block of the same condition
so it is safe to merge the two if blocks with the same condition into
one.
No intended change in behavior.
Signed-off-by: Quentin Schulz <quentin.schulz at cherry.de>
---
drivers/ram/rockchip/sdram_rk3399.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c
index 5a82c7ccbdf161526f0d1450dde6881441e59543..d953dda13cd3daa689fa362dc511c372db454064 100644
--- a/drivers/ram/rockchip/sdram_rk3399.c
+++ b/drivers/ram/rockchip/sdram_rk3399.c
@@ -811,9 +811,7 @@ static int pctl_start(struct dram_info *dram,
if (channel_mask & 1) {
writel(0x01000000, &ddrc0_con_0);
clrsetbits_le32(&denali_phy_0[957], 0x3 << 24, 0x2 << 24);
- }
- if (channel_mask & 1) {
count = 0;
while (!(readl(&denali_ctl_0[203]) & (1 << 3))) {
if (count > 1000) {
@@ -849,8 +847,7 @@ static int pctl_start(struct dram_info *dram,
if (channel_mask & 2) {
writel(0x01000000, &ddrc1_con_0);
clrsetbits_le32(&denali_phy_1[957], 0x3 << 24, 0x2 << 24);
- }
- if (channel_mask & 2) {
+
count = 0;
while (!(readl(&denali_ctl_1[203]) & (1 << 3))) {
if (count > 1000) {
--
2.47.0
More information about the U-Boot
mailing list