Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

video: fbdev: cyber2000fb.c: use container_of to resolve cfb_info from fb_info

Use container_of instead of casting first structure member.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

authored by

Fabian Frederick and committed by
Tomi Valkeinen
46ffbe20 c4e42323

+8 -8
+8 -8
drivers/video/fbdev/cyber2000fb.c
··· 159 159 static void 160 160 cyber2000fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) 161 161 { 162 - struct cfb_info *cfb = (struct cfb_info *)info; 162 + struct cfb_info *cfb = container_of(info, struct cfb_info, fb); 163 163 unsigned long dst, col; 164 164 165 165 if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT)) { ··· 191 191 static void 192 192 cyber2000fb_copyarea(struct fb_info *info, const struct fb_copyarea *region) 193 193 { 194 - struct cfb_info *cfb = (struct cfb_info *)info; 194 + struct cfb_info *cfb = container_of(info, struct cfb_info, fb); 195 195 unsigned int cmd = CO_CMD_L_PATTERN_FGCOL; 196 196 unsigned long src, dst; 197 197 ··· 241 241 242 242 static int cyber2000fb_sync(struct fb_info *info) 243 243 { 244 - struct cfb_info *cfb = (struct cfb_info *)info; 244 + struct cfb_info *cfb = container_of(info, struct cfb_info, fb); 245 245 int count = 100000; 246 246 247 247 if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT)) ··· 276 276 cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, 277 277 u_int transp, struct fb_info *info) 278 278 { 279 - struct cfb_info *cfb = (struct cfb_info *)info; 279 + struct cfb_info *cfb = container_of(info, struct cfb_info, fb); 280 280 struct fb_var_screeninfo *var = &cfb->fb.var; 281 281 u32 pseudo_val; 282 282 int ret = 1; ··· 758 758 static int 759 759 cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) 760 760 { 761 - struct cfb_info *cfb = (struct cfb_info *)info; 761 + struct cfb_info *cfb = container_of(info, struct cfb_info, fb); 762 762 struct par_info hw; 763 763 unsigned int mem; 764 764 int err; ··· 861 861 862 862 static int cyber2000fb_set_par(struct fb_info *info) 863 863 { 864 - struct cfb_info *cfb = (struct cfb_info *)info; 864 + struct cfb_info *cfb = container_of(info, struct cfb_info, fb); 865 865 struct fb_var_screeninfo *var = &cfb->fb.var; 866 866 struct par_info hw; 867 867 unsigned int mem; ··· 971 971 static int 972 972 cyber2000fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) 973 973 { 974 - struct cfb_info *cfb = (struct cfb_info *)info; 974 + struct cfb_info *cfb = container_of(info, struct cfb_info, fb); 975 975 976 976 if (cyber2000fb_update_start(cfb, var)) 977 977 return -EINVAL; ··· 1007 1007 */ 1008 1008 static int cyber2000fb_blank(int blank, struct fb_info *info) 1009 1009 { 1010 - struct cfb_info *cfb = (struct cfb_info *)info; 1010 + struct cfb_info *cfb = container_of(info, struct cfb_info, fb); 1011 1011 unsigned int sync = 0; 1012 1012 int i; 1013 1013