2019-08-06 07:52:50

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH] i2c: designware: Fix unused variable warning in i2c_dw_init_recovery_info

Fix the following warning:

drivers/i2c/busses/i2c-designware-master.c: In function ‘i2c_dw_init_recovery_info’:
drivers/i2c/busses/i2c-designware-master.c:658:6: warning: unused variable ‘r’ [-Wunused-variable]
int r;
^

Fixes: 33eb09a02e8d ("i2c: designware: make use of devm_gpiod_get_optional")
Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
drivers/i2c/busses/i2c-designware-master.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c
index 867787dade43..e8b328242256 100644
--- a/drivers/i2c/busses/i2c-designware-master.c
+++ b/drivers/i2c/busses/i2c-designware-master.c
@@ -655,7 +655,6 @@ static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev)
struct i2c_bus_recovery_info *rinfo = &dev->rinfo;
struct i2c_adapter *adap = &dev->adapter;
struct gpio_desc *gpio;
- int r;

gpio = devm_gpiod_get_optional(dev->dev, "scl", GPIOD_OUT_HIGH);
if (IS_ERR_OR_NULL(gpio))
--
2.22.0


2019-08-06 08:51:59

by Jarkko Nikula

[permalink] [raw]
Subject: Re: [PATCH] i2c: designware: Fix unused variable warning in i2c_dw_init_recovery_info

Hi

On 8/6/19 10:50 AM, Gustavo A. R. Silva wrote:
> Fix the following warning:
>
> drivers/i2c/busses/i2c-designware-master.c: In function ‘i2c_dw_init_recovery_info’:
> drivers/i2c/busses/i2c-designware-master.c:658:6: warning: unused variable ‘r’ [-Wunused-variable]
> int r;
> ^
>
> Fixes: 33eb09a02e8d ("i2c: designware: make use of devm_gpiod_get_optional")
> Signed-off-by: Gustavo A. R. Silva <[email protected]>
> ---
This was fixed yesterday, not applied yet though:

https://www.spinics.net/lists/linux-i2c/msg41651.html

--
Jarkko