kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: dac: remove redundant pointer chip_info and spi_dev_id
@ 2018-07-02 10:13 Colin King
  2018-07-07 16:47 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-07-02 10:13 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Silvan Murer, linux-iio
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Pointers chip_info and spi_dev_id are being assigned but are never used
hence they are redundant and can be removed.

Cleans up clang warning:
warning: variable 'chip_info' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/iio/dac/ltc2632.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/iio/dac/ltc2632.c b/drivers/iio/dac/ltc2632.c
index cca278eaa138..28e9b7656b20 100644
--- a/drivers/iio/dac/ltc2632.c
+++ b/drivers/iio/dac/ltc2632.c
@@ -87,12 +87,7 @@ static int ltc2632_read_raw(struct iio_dev *indio_dev,
 			    int *val2,
 			    long m)
 {
-	struct ltc2632_chip_info *chip_info;
-
 	const struct ltc2632_state *st = iio_priv(indio_dev);
-	const struct spi_device_id *spi_dev_id = spi_get_device_id(st->spi_dev);
-
-	chip_info = (struct ltc2632_chip_info *)spi_dev_id->driver_data;
 
 	switch (m) {
 	case IIO_CHAN_INFO_SCALE:
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: dac: remove redundant pointer chip_info and spi_dev_id
  2018-07-02 10:13 [PATCH] iio: dac: remove redundant pointer chip_info and spi_dev_id Colin King
@ 2018-07-07 16:47 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2018-07-07 16:47 UTC (permalink / raw)
  To: Colin King
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Silvan Murer, linux-iio, kernel-janitors, linux-kernel

On Mon,  2 Jul 2018 11:13:59 +0100
Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> Pointers chip_info and spi_dev_id are being assigned but are never used
> hence they are redundant and can be removed.
> 
> Cleans up clang warning:
> warning: variable 'chip_info' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Huh, I wonder how we ended up with that being left behind? 
Not that I wonder enough to actually look ;)

Thanks and good to get rid of these 'interesting'
corners :)

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/ltc2632.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/iio/dac/ltc2632.c b/drivers/iio/dac/ltc2632.c
> index cca278eaa138..28e9b7656b20 100644
> --- a/drivers/iio/dac/ltc2632.c
> +++ b/drivers/iio/dac/ltc2632.c
> @@ -87,12 +87,7 @@ static int ltc2632_read_raw(struct iio_dev *indio_dev,
>  			    int *val2,
>  			    long m)
>  {
> -	struct ltc2632_chip_info *chip_info;
> -
>  	const struct ltc2632_state *st = iio_priv(indio_dev);
> -	const struct spi_device_id *spi_dev_id = spi_get_device_id(st->spi_dev);
> -
> -	chip_info = (struct ltc2632_chip_info *)spi_dev_id->driver_data;
>  
>  	switch (m) {
>  	case IIO_CHAN_INFO_SCALE:


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-07 16:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-02 10:13 [PATCH] iio: dac: remove redundant pointer chip_info and spi_dev_id Colin King
2018-07-07 16:47 ` 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).