[2/2] soc: qcom: dcc: Delete some bogus dead code

Message ID Y7asVSr5ERGCZedk@kili
State New
Headers
Series [1/2] soc: qcom: dcc: Signedness bug in config_reset_write() |

Commit Message

Dan Carpenter Jan. 5, 2023, 10:54 a.m. UTC
  It feels very wrong to assign "cfg.sram_offset" to be out of bounds.
Fortunately, this is just dead code and can be deleted.

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
 drivers/soc/qcom/dcc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Patch

diff --git a/drivers/soc/qcom/dcc.c b/drivers/soc/qcom/dcc.c
index 1e2cbefc1655..681d55018e66 100644
--- a/drivers/soc/qcom/dcc.c
+++ b/drivers/soc/qcom/dcc.c
@@ -483,10 +483,8 @@  static int dcc_emit_config(struct dcc_drvdata *drvdata, unsigned int curr_list)
 	/* Update ram_cfg and check if the data will overstep */
 	drvdata->ram_cfg = (cfg.sram_offset + total_len) / 4;
 
-	if (cfg.sram_offset + total_len > drvdata->ram_size) {
-		cfg.sram_offset += total_len;
+	if (cfg.sram_offset + total_len > drvdata->ram_size)
 		goto overstep;
-	}
 
 	drvdata->ram_start = cfg.sram_offset / 4;
 	return 0;