diff mbox series

[next,RFC,4/5] ram: rk3399: merge two consecutive ifs with same condition

Message ID 20241105-rk3399-dram-init-v1-4-1e29acdf0966@cherry.de
State New
Headers show
Series rockchip: panic() when DRAM init fails | expand

Commit Message

Quentin Schulz Nov. 5, 2024, 5:21 p.m. UTC
From: Quentin Schulz <quentin.schulz@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@cherry.de>
---
 drivers/ram/rockchip/sdram_rk3399.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

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) {