[PATCH -next] i2c: qcom-cci: Remove the unused variable cci_clk_rate

Jiapeng Chong posted 1 patch 1 month ago
There is a newer version of this series
drivers/i2c/busses/i2c-qcom-cci.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH -next] i2c: qcom-cci: Remove the unused variable cci_clk_rate
Posted by Jiapeng Chong 1 month ago
Variable ret is not effectively used, so delete it.

drivers/i2c/busses/i2c-qcom-cci.c:526:16: warning: variable ‘cci_clk_rate’ set but not used.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=11532
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/i2c/busses/i2c-qcom-cci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
index 5cc791b3b57d..c7c4fbf73183 100644
--- a/drivers/i2c/busses/i2c-qcom-cci.c
+++ b/drivers/i2c/busses/i2c-qcom-cci.c
@@ -523,7 +523,6 @@ static const struct dev_pm_ops qcom_cci_pm = {
 static int cci_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	unsigned long cci_clk_rate = 0;
 	struct device_node *child;
 	struct resource *r;
 	struct cci *cci;
@@ -597,7 +596,7 @@ static int cci_probe(struct platform_device *pdev)
 	/* Retrieve CCI clock rate */
 	for (i = 0; i < cci->nclocks; i++) {
 		if (!strcmp(cci->clocks[i].id, "cci")) {
-			cci_clk_rate = clk_get_rate(cci->clocks[i].clk);
+			clk_get_rate(cci->clocks[i].clk);
 			break;
 		}
 	}
-- 
2.32.0.3.g01195cf9f

Re: [PATCH -next] i2c: qcom-cci: Remove the unused variable cci_clk_rate
Posted by Dmitry Baryshkov 1 month ago
On Fri, Oct 25, 2024 at 04:57:28PM +0800, Jiapeng Chong wrote:
> Variable ret is not effectively used, so delete it.
> 
> drivers/i2c/busses/i2c-qcom-cci.c:526:16: warning: variable ‘cci_clk_rate’ set but not used.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=11532
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/i2c/busses/i2c-qcom-cci.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
> index 5cc791b3b57d..c7c4fbf73183 100644
> --- a/drivers/i2c/busses/i2c-qcom-cci.c
> +++ b/drivers/i2c/busses/i2c-qcom-cci.c
> @@ -523,7 +523,6 @@ static const struct dev_pm_ops qcom_cci_pm = {
>  static int cci_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
> -	unsigned long cci_clk_rate = 0;
>  	struct device_node *child;
>  	struct resource *r;
>  	struct cci *cci;
> @@ -597,7 +596,7 @@ static int cci_probe(struct platform_device *pdev)
>  	/* Retrieve CCI clock rate */
>  	for (i = 0; i < cci->nclocks; i++) {
>  		if (!strcmp(cci->clocks[i].id, "cci")) {
> -			cci_clk_rate = clk_get_rate(cci->clocks[i].clk);
> +			clk_get_rate(cci->clocks[i].clk);

Why do you need this call if the result is unused?

>  			break;
>  		}
>  	}
> -- 
> 2.32.0.3.g01195cf9f
> 

-- 
With best wishes
Dmitry