[PATCH linux-next] soc: qcom: icc-bwmon: remove redundant ret variable

cgel.zte@gmail.com posted 1 patch 3 years, 7 months ago
drivers/soc/qcom/icc-bwmon.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
[PATCH linux-next] soc: qcom: icc-bwmon: remove redundant ret variable
Posted by cgel.zte@gmail.com 3 years, 7 months ago
From: Jinpeng Cui <cui.jinpeng2@zte.com.cn>

Return value from devm_regmap_field_bulk_alloc() directly
instead of taking this in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Jinpeng Cui <cui.jinpeng2@zte.com.cn>
---
 drivers/soc/qcom/icc-bwmon.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/qcom/icc-bwmon.c b/drivers/soc/qcom/icc-bwmon.c
index 47c2c3e7bb3f..9df47afb0d81 100644
--- a/drivers/soc/qcom/icc-bwmon.c
+++ b/drivers/soc/qcom/icc-bwmon.c
@@ -551,7 +551,6 @@ static int bwmon_init_regmap(struct platform_device *pdev,
 	struct device *dev = &pdev->dev;
 	void __iomem *base;
 	struct regmap *map;
-	int ret;
 
 	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
@@ -565,11 +564,10 @@ static int bwmon_init_regmap(struct platform_device *pdev,
 
 	BUILD_BUG_ON(ARRAY_SIZE(msm8998_bwmon_reg_fields) != F_NUM_FIELDS);
 	BUILD_BUG_ON(ARRAY_SIZE(sdm845_llcc_bwmon_reg_fields) != F_NUM_FIELDS);
-	ret = devm_regmap_field_bulk_alloc(dev, map, bwmon->regs,
+
+	return devm_regmap_field_bulk_alloc(dev, map, bwmon->regs,
 					   bwmon->data->regmap_fields,
 					   F_NUM_FIELDS);
-
-	return ret;
 }
 
 static int bwmon_probe(struct platform_device *pdev)
-- 
2.25.1
Re: [PATCH linux-next] soc: qcom: icc-bwmon: remove redundant ret variable
Posted by Bjorn Andersson 3 years, 7 months ago
On Tue, 23 Aug 2022 13:36:20 +0000, cgel.zte@gmail.com wrote:
> From: Jinpeng Cui <cui.jinpeng2@zte.com.cn>
> 
> Return value from devm_regmap_field_bulk_alloc() directly
> instead of taking this in another redundant variable.
> 
> 

Applied, thanks!

[1/1] soc: qcom: icc-bwmon: remove redundant ret variable
      commit: 7eb89c17abd2574f627c1277a15f6ff64bec33a4

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>
Re: [PATCH linux-next] soc: qcom: icc-bwmon: remove redundant ret variable
Posted by Krzysztof Kozlowski 3 years, 7 months ago
On 23/08/2022 16:36, cgel.zte@gmail.com wrote:
> From: Jinpeng Cui <cui.jinpeng2@zte.com.cn>
> 
> Return value from devm_regmap_field_bulk_alloc() directly
> instead of taking this in another redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>

I cannot find this report. This is an open source work and public
collaboration. The "Reported-by" usually means that the issue was
reported to us, in some way, usually in public. Can we see the report?
Otherwise adding non-public, non-verifiable reports is useless and
clutters our report-credit-system.


> Signed-off-by: Jinpeng Cui <cui.jinpeng2@zte.com.cn>
> ---
>  drivers/soc/qcom/icc-bwmon.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof