]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: nvec: nvec.c: Drop void pointer cast
authorJanani Ravichandran <janani.rvchndrn@gmail.com>
Thu, 25 Feb 2016 20:17:38 +0000 (15:17 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Mar 2016 06:09:09 +0000 (22:09 -0800)
Void pointers need not be cast to other pointer types.
Semantic patch used:

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

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

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/nvec/nvec.c

index f6a1dbb4b66be1e049e24ea58f2fc301393cff8c..9fda136b8e05ea333e6868e4dfa8808f55cd4398 100644 (file)
@@ -141,7 +141,7 @@ static int nvec_status_notifier(struct notifier_block *nb,
 {
        struct nvec_chip *nvec = container_of(nb, struct nvec_chip,
                                                nvec_status_notifier);
-       unsigned char *msg = (unsigned char *)data;
+       unsigned char *msg = data;
 
        if (event_type != NVEC_CNTL)
                return NOTIFY_DONE;