Staging: comedi: Remove unnecessary cast on void pointer
authorShraddha Barke <shraddha.6596@gmail.com>
Wed, 14 Oct 2015 19:28:26 +0000 (00:58 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Oct 2015 05:51:48 +0000 (22:51 -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
)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/amplc_pci230.c
drivers/staging/comedi/drivers/cb_pcidas.c

index 5c5c4e2ec3d5ede539277e28a62efd3a26ed829e..4b39f6960c0a6fba15ca00ecdf6003e8aac321f9 100644 (file)
@@ -2275,7 +2275,7 @@ static int pci230_ai_cancel(struct comedi_device *dev,
 static irqreturn_t pci230_interrupt(int irq, void *d)
 {
        unsigned char status_int, valid_status_int, temp_ier;
-       struct comedi_device *dev = (struct comedi_device *)d;
+       struct comedi_device *dev = d;
        struct pci230_private *devpriv = dev->private;
        struct comedi_subdevice *s_ao = dev->write_subdev;
        struct comedi_subdevice *s_ai = dev->read_subdev;
index b43e836575fd10b9ae8b175875c0d7f8e959108c..b589e17379cc41f688f61b5b9fcfea54df2232e0 100644 (file)
@@ -1234,7 +1234,7 @@ static void handle_ao_interrupt(struct comedi_device *dev, unsigned int status)
 
 static irqreturn_t cb_pcidas_interrupt(int irq, void *d)
 {
-       struct comedi_device *dev = (struct comedi_device *)d;
+       struct comedi_device *dev = d;
        const struct cb_pcidas_board *board = dev->board_ptr;
        struct cb_pcidas_private *devpriv = dev->private;
        struct comedi_subdevice *s = dev->read_subdev;