staging: cptm1217: Remove useless cast on void pointer
authorTapasweni Pathak <tapaswenipathak@gmail.com>
Thu, 30 Oct 2014 11:31:38 +0000 (17:01 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Oct 2014 20:05:46 +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/cptm1217/clearpad_tm1217.c

index edf9ff2ea25b32020161b92dc8f1df4edd4d217b..7f265ce0dd13de32dfc8813c7d4855b117310845 100644 (file)
@@ -278,7 +278,7 @@ static void cp_tm1217_get_data(struct cp_tm1217_device *ts)
 
 static irqreturn_t cp_tm1217_sample_thread(int irq, void *handle)
 {
-       struct cp_tm1217_device *ts = (struct cp_tm1217_device *) handle;
+       struct cp_tm1217_device *ts = handle;
        u8 req[2];
        int retval;