]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: mt29f_spinand: Drop void pointer cast
authorJanani Ravichandran <janani.rvchndrn@gmail.com>
Thu, 25 Feb 2016 19:51:06 +0000 (14:51 -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/mt29f_spinand/mt29f_spinand.c

index 75fe61c54ee5e9951e08f237b5faf0d718949752..aa0170e4ef6fc06c5f554e5b7da12abc497d14f5 100644 (file)
@@ -33,7 +33,7 @@ static inline struct spinand_state *mtd_to_state(struct mtd_info *mtd)
 {
        struct nand_chip *chip = mtd_to_nand(mtd);
        struct spinand_info *info = nand_get_controller_data(chip);
-       struct spinand_state *state = (struct spinand_state *)info->priv;
+       struct spinand_state *state = info->priv;
 
        return state;
 }
@@ -749,7 +749,7 @@ static void spinand_cmdfunc(struct mtd_info *mtd, unsigned int command,
 {
        struct nand_chip *chip = mtd_to_nand(mtd);
        struct spinand_info *info = nand_get_controller_data(chip);
-       struct spinand_state *state = (struct spinand_state *)info->priv;
+       struct spinand_state *state = info->priv;
 
        switch (command) {
        /*