[PATCH 2/2] soc: qcom: dcc: Delete some bogus dead code
From: Dan Carpenter
Date: Thu Jan 05 2023 - 05:55:14 EST
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@xxxxxxxxx>
---
drivers/soc/qcom/dcc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
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;
--
2.35.1