staging: media: davinci_vpfe: Remove useless cast on void pointer
authorTapasweni Pathak <tapaswenipathak@gmail.com>
Thu, 30 Oct 2014 11:32:36 +0000 (17:02 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Oct 2014 20:05:47 +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/media/davinci_vpfe/dm365_ipipeif.c
drivers/staging/media/davinci_vpfe/dm365_resizer.c

index 6d4893b44c1ff9d6a968e01ef8bab95b7f4cc53c..413acbb9e948d9655539f79e9a872d8cc96966d1 100644 (file)
@@ -421,7 +421,7 @@ static int
 ipipeif_get_config(struct v4l2_subdev *sd, void __user *arg)
 {
        struct vpfe_ipipeif_device *ipipeif = v4l2_get_subdevdata(sd);
-       struct ipipeif_params *config = (struct ipipeif_params *)arg;
+       struct ipipeif_params *config = arg;
        struct device *dev = ipipeif->subdev.v4l2_dev->dev;
 
        if (!arg) {
@@ -462,7 +462,7 @@ ipipeif_get_config(struct v4l2_subdev *sd, void __user *arg)
 static long ipipeif_ioctl(struct v4l2_subdev *sd,
                          unsigned int cmd, void *arg)
 {
-       struct ipipeif_params *config = (struct ipipeif_params *)arg;
+       struct ipipeif_params *config = arg;
        int ret = -ENOIOCTLCMD;
 
        switch (cmd) {
index 415502651033da8824db84212ad7770e3f26f90b..36fc15ad190cea2ec8050d98b58369702351f337 100644 (file)
@@ -149,7 +149,7 @@ configure_resizer_out_params(struct vpfe_resizer_device *resizer, int index,
                param->rsz_en[index] = DISABLE;
                return;
        }
-       output = (struct vpfe_rsz_output_spec *)output_spec;
+       output = output_spec;
        param->rsz_en[index] = ENABLE;
        if (partial) {
                param->rsz_rsc_param[index].h_flip = output->h_flip;
@@ -1218,12 +1218,12 @@ static long resizer_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
 
        switch (cmd) {
        case VIDIOC_VPFE_RSZ_S_CONFIG:
-               user_config = (struct vpfe_rsz_config *)arg;
+               user_config = arg;
                ret = resizer_set_configuration(resizer, user_config);
                break;
 
        case VIDIOC_VPFE_RSZ_G_CONFIG:
-               user_config = (struct vpfe_rsz_config *)arg;
+               user_config = arg;
                if (!user_config->config) {
                        dev_err(dev, "error in VIDIOC_VPFE_RSZ_G_CONFIG\n");
                        return -EINVAL;