staging: fbtft: fb_uc1611.c: Drop void pointer cast
authorJanani Ravichandran <janani.rvchndrn@gmail.com>
Thu, 25 Feb 2016 18:44:39 +0000 (13:44 -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/fbtft/fb_uc1611.c

index 4e82814..e87401a 100644 (file)
@@ -222,8 +222,8 @@ static int set_var(struct fbtft_par *par)
 static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 {
        u8 *vmem8 = (u8 *)(par->info->screen_buffer);
-       u8 *buf8 = (u8 *)(par->txbuf.buf);
-       u16 *buf16 = (u16 *)(par->txbuf.buf);
+       u8 *buf8 = par->txbuf.buf;
+       u16 *buf16 = par->txbuf.buf;
        int line_length = par->info->fix.line_length;
        int y_start = (offset / line_length);
        int y_end = (offset + len - 1) / line_length;