staging: iio: adc: Remove useless cast on void pointer
authorTapasweni Pathak <tapaswenipathak@gmail.com>
Thu, 30 Oct 2014 11:32:25 +0000 (17:02 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Oct 2014 20:05:47 +0000 (13:05 -0700)
void pointers do not need to be cast to other pointer types.

The semantic patch used to find this:

@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Build tested it.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/adc/ad7606_spi.c
drivers/staging/iio/adc/lpc32xx_adc.c
drivers/staging/iio/adc/spear_adc.c

index 6a8ecd73a1a79775ed424eb92c23ce3af7732b6b..7303983e64a7262653ba95611ff8a30ce8d743c8 100644 (file)
@@ -23,7 +23,7 @@ static int ad7606_spi_read_block(struct device *dev,
        int i, ret;
        unsigned short *data = buf;
 
-       ret = spi_read(spi, (u8 *)buf, count * 2);
+       ret = spi_read(spi, buf, count * 2);
        if (ret < 0) {
                dev_err(&spi->dev, "SPI read error\n");
                return ret;
index a876ce7553517523b14428b101e4fc77b25fe234..84a53a9430efaa2e2c0f64993f2173c2c55769f0 100644 (file)
@@ -116,7 +116,7 @@ static const struct iio_chan_spec lpc32xx_adc_iio_channels[] = {
 
 static irqreturn_t lpc32xx_adc_isr(int irq, void *dev_id)
 {
-       struct lpc32xx_adc_info *info = (struct lpc32xx_adc_info *) dev_id;
+       struct lpc32xx_adc_info *info = dev_id;
 
        /* Read value and clear irq */
        info->value = __raw_readl(LPC32XX_ADC_VALUE(info->adc_base)) &
index 67a364c2e794ce150412be0dfb6bc4f3590187c9..de37b35ea15493add291f068aef2b0d077d94d91 100644 (file)
@@ -226,7 +226,7 @@ static const struct iio_chan_spec spear_adc_iio_channels[] = {
 
 static irqreturn_t spear_adc_isr(int irq, void *dev_id)
 {
-       struct spear_adc_state *st = (struct spear_adc_state *)dev_id;
+       struct spear_adc_state *st = dev_id;
 
        /* Read value to clear IRQ */
        st->value = spear_adc_get_average(st);