]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
MXC IPUv3 fb: remove bogus type casts
authorLothar Waßmann <LW@KARO-electronics.de>
Fri, 13 Jun 2014 13:36:30 +0000 (15:36 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 13 Jun 2014 13:36:30 +0000 (15:36 +0200)
drivers/video/mxc/mxc_ipuv3_fb.c

index e5b8733249c232fb46e43d4338c07838a9b6c6e9..1c15d4ad5be7b129d605a7a3f7ce03851f7b7c22 100644 (file)
@@ -238,8 +238,7 @@ static struct fb_info *found_registered_fb(ipu_channel_t ipu_ch, int ipu_id)
        struct fb_info *fbi = NULL;
 
        for (i = 0; i < num_registered_fb; i++) {
-               mxc_fbi =
-                       ((struct mxcfb_info *)(registered_fb[i]->par));
+               mxc_fbi = registered_fb[i]->par;
 
                if ((mxc_fbi->ipu_ch == ipu_ch) &&
                        (mxc_fbi->ipu_id == ipu_id)) {
@@ -281,7 +280,7 @@ static int mxcfb_set_fix(struct fb_info *info)
 static int _setup_disp_channel1(struct fb_info *fbi)
 {
        ipu_channel_params_t params;
-       struct mxcfb_info *mxc_fbi = (struct mxcfb_info *)fbi->par;
+       struct mxcfb_info *mxc_fbi = fbi->par;
 
        memset(&params, 0, sizeof(params));
 
@@ -308,7 +307,7 @@ static int _setup_disp_channel1(struct fb_info *fbi)
 static int _setup_disp_channel2(struct fb_info *fbi)
 {
        int retval = 0;
-       struct mxcfb_info *mxc_fbi = (struct mxcfb_info *)fbi->par;
+       struct mxcfb_info *mxc_fbi = fbi->par;
        int fb_stride;
        unsigned long base;
        unsigned int fr_xoff, fr_yoff, fr_w, fr_h;
@@ -438,7 +437,7 @@ static int mxcfb_set_par(struct fb_info *fbi)
        int retval = 0;
        u32 mem_len, alpha_mem_len;
        ipu_di_signal_cfg_t sig_cfg;
-       struct mxcfb_info *mxc_fbi = (struct mxcfb_info *)fbi->par;
+       struct mxcfb_info *mxc_fbi = fbi->par;
 
        int16_t ov_pos_x = 0, ov_pos_y = 0;
        int ov_pos_ret = 0;
@@ -453,7 +452,7 @@ static int mxcfb_set_par(struct fb_info *fbi)
        }
 
        if (mxc_fbi->ovfbi)
-               mxc_fbi_fg = (struct mxcfb_info *)mxc_fbi->ovfbi->par;
+               mxc_fbi_fg = mxc_fbi->ovfbi->par;
 
        if (mxc_fbi->ovfbi && mxc_fbi_fg)
                if (mxc_fbi_fg->next_blank == FB_BLANK_UNBLANK)
@@ -514,7 +513,7 @@ static int mxcfb_set_par(struct fb_info *fbi)
                 * the same to kernel fb pixel format.
                 */
                if (mxc_fbi->late_init)
-                       memset((char *)fbi->screen_base, 0, fbi->fix.smem_len);
+                       memset(fbi->screen_base, 0, fbi->fix.smem_len);
 
                mxc_fbi->first_set_par = false;
        }
@@ -674,8 +673,8 @@ static int _swap_channels(struct fb_info *fbi_from,
        int retval, tmp;
        ipu_channel_t old_ch;
        struct fb_info *ovfbi;
-       struct mxcfb_info *mxc_fbi_from = (struct mxcfb_info *)fbi_from->par;
-       struct mxcfb_info *mxc_fbi_to = (struct mxcfb_info *)fbi_to->par;
+       struct mxcfb_info *mxc_fbi_from = fbi_from->par;
+       struct mxcfb_info *mxc_fbi_to = fbi_to->par;
 
        if (both_on) {
                ipu_disable_channel(mxc_fbi_to->ipu, mxc_fbi_to->ipu_ch, true);
@@ -721,7 +720,7 @@ static int swap_channels(struct fb_info *fbi_from)
        int i;
        int swap_mode;
        ipu_channel_t ch_to;
-       struct mxcfb_info *mxc_fbi_from = (struct mxcfb_info *)fbi_from->par;
+       struct mxcfb_info *mxc_fbi_from = fbi_from->par;
        struct fb_info *fbi_to = NULL;
        struct mxcfb_info *mxc_fbi_to;
 
@@ -734,7 +733,7 @@ static int swap_channels(struct fb_info *fbi_from)
        fbi_to = found_registered_fb(ch_to, mxc_fbi_from->ipu_id);
        if (!fbi_to)
                return -1;
-       mxc_fbi_to = (struct mxcfb_info *)fbi_to->par;
+       mxc_fbi_to = fbi_to->par;
 
        ipu_clear_irq(mxc_fbi_from->ipu, mxc_fbi_from->ipu_ch_irq);
        ipu_clear_irq(mxc_fbi_to->ipu, mxc_fbi_to->ipu_ch_irq);
@@ -832,7 +831,7 @@ static int mxcfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 {
        u32 vtotal;
        u32 htotal;
-       struct mxcfb_info *mxc_fbi = (struct mxcfb_info *)info->par;
+       struct mxcfb_info *mxc_fbi = info->par;
 
 
        if (var->xres == 0 || var->yres == 0)
@@ -961,14 +960,14 @@ static int mxcfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
 {
        int retval = 0;
        int __user *argp = (void __user *)arg;
-       struct mxcfb_info *mxc_fbi = (struct mxcfb_info *)fbi->par;
+       struct mxcfb_info *mxc_fbi = fbi->par;
 
        switch (cmd) {
        case MXCFB_SET_GBL_ALPHA:
                {
                        struct mxcfb_gbl_alpha ga;
 
-                       if (copy_from_user(&ga, (void *)arg, sizeof(ga))) {
+                       if (copy_from_user(&ga, argp, sizeof(ga))) {
                                retval = -EFAULT;
                                break;
                        }
@@ -996,7 +995,7 @@ static int mxcfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
                        bool bad_pixfmt =
                                ipu_ch_param_bad_alpha_pos(fbi_to_pixfmt(fbi));
 
-                       if (copy_from_user(&la, (void *)arg, sizeof(la))) {
+                       if (copy_from_user(&la, argp, sizeof(la))) {
                                retval = -EFAULT;
                                break;
                        }
@@ -1042,7 +1041,7 @@ static int mxcfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
 
                        la.alpha_phy_addr0 = mxc_fbi->alpha_phy_addr0;
                        la.alpha_phy_addr1 = mxc_fbi->alpha_phy_addr1;
-                       if (copy_to_user((void *)arg, &la, sizeof(la))) {
+                       if (copy_to_user(argp, &la, sizeof(la))) {
                                retval = -EFAULT;
                                break;
                        }
@@ -1116,7 +1115,7 @@ static int mxcfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
        case MXCFB_SET_CLR_KEY:
                {
                        struct mxcfb_color_key key;
-                       if (copy_from_user(&key, (void *)arg, sizeof(key))) {
+                       if (copy_from_user(&key, argp, sizeof(key))) {
                                retval = -EFAULT;
                                break;
                        }
@@ -1130,7 +1129,7 @@ static int mxcfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
        case MXCFB_SET_GAMMA:
                {
                        struct mxcfb_gamma gamma;
-                       if (copy_from_user(&gamma, (void *)arg, sizeof(gamma))) {
+                       if (copy_from_user(&gamma, argp, sizeof(gamma))) {
                                retval = -EFAULT;
                                break;
                        }
@@ -1251,7 +1250,7 @@ static int mxcfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
                                break;
                        }
 
-                       if (copy_from_user(&pos, (void *)arg, sizeof(pos))) {
+                       if (copy_from_user(&pos, argp, sizeof(pos))) {
                                retval = -EFAULT;
                                break;
                        }
@@ -1286,7 +1285,7 @@ static int mxcfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
                        retval = ipu_disp_set_window_pos(mxc_fbi->ipu, mxc_fbi->ipu_ch,
                                                         pos.x, pos.y);
 
-                       if (copy_to_user((void *)arg, &pos, sizeof(pos))) {
+                       if (copy_to_user(argp, &pos, sizeof(pos))) {
                                retval = -EFAULT;
                                break;
                        }
@@ -1342,7 +1341,7 @@ static int mxcfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
                {
                        struct mxcfb_csc_matrix csc;
 
-                       if (copy_from_user(&csc, (void *) arg, sizeof(csc)))
+                       if (copy_from_user(&csc, argp, sizeof(csc)))
                                return -EFAULT;
 
                        if ((mxc_fbi->ipu_ch != MEM_FG_SYNC) &&
@@ -2180,7 +2179,7 @@ static int mxcfb_setup_overlay(struct platform_device *pdev,
                ret = -ENOMEM;
                goto init_ovfbinfo_failed;
        }
-       mxcfbi_fg = (struct mxcfb_info *)ovfbi->par;
+       mxcfbi_fg = ovfbi->par;
 
        mxcfbi_fg->ipu = ipu_get_soc(mxcfbi_bg->ipu_id);
        if (IS_ERR(mxcfbi_fg->ipu)) {
@@ -2227,7 +2226,7 @@ init_ovfbinfo_failed:
 
 static void mxcfb_unsetup_overlay(struct fb_info *fbi_bg)
 {
-       struct mxcfb_info *mxcfbi_bg = (struct mxcfb_info *)fbi_bg->par;
+       struct mxcfb_info *mxcfbi_bg = fbi_bg->par;
        struct fb_info *ovfbi = mxcfbi_bg->ovfbi;
 
        mxcfb_unregister(ovfbi);
@@ -2378,7 +2377,7 @@ static int mxcfb_probe(struct platform_device *pdev)
        if (ret)
                goto get_fb_option_failed;
 
-       mxcfbi = (struct mxcfb_info *)fbi->par;
+       mxcfbi = fbi->par;
        mxcfbi->ipu_int_clk = plat_data->int_clk;
        mxcfbi->late_init = plat_data->late_init;
        mxcfbi->first_set_par = true;