* [PATCH -next] iio: dac: ad5758: remove set but not used variable 'dc_dc_mode'
@ 2019-04-26 16:40 Yue Haibing
2019-04-27 13:16 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Yue Haibing @ 2019-04-26 16:40 UTC (permalink / raw)
To: stefan.popa, lars, Michael.Hennerich, jic23, knaack.h, pmeerw
Cc: linux-kernel, linux-iio, YueHaibing
From: YueHaibing <yuehaibing@huawei.com>
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/iio/dac/ad5758.c: In function ad5758_write_powerdown:
drivers/iio/dac/ad5758.c:585:15: warning: variable dc_dc_mode set but not used [-Wunused-but-set-variable]
It is not used any more since
commit edde945257e2 ("iio: dac: ad5758: Modifications for new revision")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/iio/dac/ad5758.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/iio/dac/ad5758.c b/drivers/iio/dac/ad5758.c
index a513c70..570f69e 100644
--- a/drivers/iio/dac/ad5758.c
+++ b/drivers/iio/dac/ad5758.c
@@ -582,7 +582,7 @@ static ssize_t ad5758_write_powerdown(struct iio_dev *indio_dev,
{
struct ad5758_state *st = iio_priv(indio_dev);
bool pwr_down;
- unsigned int dc_dc_mode, dac_config_mode, val;
+ unsigned int dac_config_mode, val;
unsigned long int dac_config_msk;
int ret;
@@ -591,13 +591,10 @@ static ssize_t ad5758_write_powerdown(struct iio_dev *indio_dev,
return ret;
mutex_lock(&st->lock);
- if (pwr_down) {
- dc_dc_mode = AD5758_DCDC_MODE_POWER_OFF;
+ if (pwr_down)
val = 0;
- } else {
- dc_dc_mode = st->dc_dc_mode;
+ else
val = 1;
- }
dac_config_mode = AD5758_DAC_CONFIG_OUT_EN_MODE(val) |
AD5758_DAC_CONFIG_INT_EN_MODE(val);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] iio: dac: ad5758: remove set but not used variable 'dc_dc_mode'
2019-04-26 16:40 [PATCH -next] iio: dac: ad5758: remove set but not used variable 'dc_dc_mode' Yue Haibing
@ 2019-04-27 13:16 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2019-04-27 13:16 UTC (permalink / raw)
To: Yue Haibing
Cc: stefan.popa, lars, Michael.Hennerich, knaack.h, pmeerw,
linux-kernel, linux-iio
On Sat, 27 Apr 2019 00:40:06 +0800
Yue Haibing <yuehaibing@huawei.com> wrote:
> From: YueHaibing <yuehaibing@huawei.com>
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/iio/dac/ad5758.c: In function ad5758_write_powerdown:
> drivers/iio/dac/ad5758.c:585:15: warning: variable dc_dc_mode set but not used [-Wunused-but-set-variable]
>
> It is not used any more since
> commit edde945257e2 ("iio: dac: ad5758: Modifications for new revision")
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.
Thanks,
Jonathan
> ---
> drivers/iio/dac/ad5758.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/iio/dac/ad5758.c b/drivers/iio/dac/ad5758.c
> index a513c70..570f69e 100644
> --- a/drivers/iio/dac/ad5758.c
> +++ b/drivers/iio/dac/ad5758.c
> @@ -582,7 +582,7 @@ static ssize_t ad5758_write_powerdown(struct iio_dev *indio_dev,
> {
> struct ad5758_state *st = iio_priv(indio_dev);
> bool pwr_down;
> - unsigned int dc_dc_mode, dac_config_mode, val;
> + unsigned int dac_config_mode, val;
> unsigned long int dac_config_msk;
> int ret;
>
> @@ -591,13 +591,10 @@ static ssize_t ad5758_write_powerdown(struct iio_dev *indio_dev,
> return ret;
>
> mutex_lock(&st->lock);
> - if (pwr_down) {
> - dc_dc_mode = AD5758_DCDC_MODE_POWER_OFF;
> + if (pwr_down)
> val = 0;
> - } else {
> - dc_dc_mode = st->dc_dc_mode;
> + else
> val = 1;
> - }
>
> dac_config_mode = AD5758_DAC_CONFIG_OUT_EN_MODE(val) |
> AD5758_DAC_CONFIG_INT_EN_MODE(val);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-04-27 13:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-26 16:40 [PATCH -next] iio: dac: ad5758: remove set but not used variable 'dc_dc_mode' Yue Haibing
2019-04-27 13:16 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).