neofb: Driver cleanups
PATCH 10/16 neofb: Driver cleanups
- remove unneeded casts
- move memory for pseudo_palette inside struct neofb_par
Signed-off-by Antonino Daplas <[email protected]>
---
drivers/video/neofb.c | 36 ++++++++++++++++++------------------ include/video/neomagic.h | 1 + 2 files changed, 19 insertions(+), 18 deletions(-)
drivers/video/neofb.c +18 -18
@@ -485,7 +485,7 @@ static void vgaHWRestore(const struct fb*/ static inline int neo2200_sync (struct fb_info *info) { -struct neofb_par *par = (struct neofb_par *) info->par; +struct neofb_par *par = info->par;int waitcycles;while (readl (&par->neo2200->bltStat) &1 )
@@ -525,7 +525,7 @@ static inline void neo2200_wait_fifo(strstatic inline void neo2200_accel_init (struct fb_info *info,struct fb_var_screeninfo *var) { -struct neofb_par *par = (struct neofb_par *) info->par; +struct neofb_par *par = info->par;Neo2200 __iomem *neo2200 = par->neo2200;u32 bltMod, pitch;
@@ -560,7 +560,7 @@ static inline void neo2200_accel_init(ststatic int neofb_open (struct fb_info *info,int user) { -struct neofb_par *par = (struct neofb_par *) info->par; +struct neofb_par *par = info->par;int cnt =atomic_read (&par->ref_count);if (!cnt) {
@@ -575,7 +575,7 @@ neofb_open(struct fb_info *info, int usestatic int neofb_release (struct fb_info *info,int user) { -struct neofb_par *par = (struct neofb_par *) info->par; +struct neofb_par *par = info->par;int cnt =atomic_read (&par->ref_count);if (!cnt)
@@ -590,7 +590,7 @@ neofb_release(struct fb_info *info, intstatic int neofb_check_var (struct fb_var_screeninfo *var,struct fb_info *info) { -struct neofb_par *par = (struct neofb_par *) info->par; +struct neofb_par *par = info->par;unsigned int pixclock = var->pixclock;struct xtimings timings;int memlen, vramlen;
@@ -757,7 +757,7 @@ neofb_check_var(struct fb_var_screeninfostatic int neofb_set_par (struct fb_info *info) { -struct neofb_par *par = (struct neofb_par *) info->par; +struct neofb_par *par = info->par;struct xtimings timings;unsigned char temp;int i, clock_hi =0 ;
@@ -1216,7 +1216,7 @@ static int neofb_set_par(struct fb_infostatic void neofb_update_start (struct fb_info *info,struct fb_var_screeninfo *var) { -struct neofb_par *par = (struct neofb_par *) info->par; +struct neofb_par *par = info->par;struct vgastate *state = &par->state;int oldExtCRTDispAddr;int Base;
@@ -1331,7 +1331,7 @@ static int neofb_blank(int blank_mode, s* wms...Enable VESA DPMS compatible powerdown mode * run "setterm -powersave powerdown" to take advantage */ -struct neofb_par *par = (struct neofb_par *)info->par; +struct neofb_par *par = info->par;int seqflags, lcdflags, dpmsflags, reg;switch (blank_mode) {
@@ -1404,7 +1404,7 @@ static int neofb_blank(int blank_mode, sstatic void neo2200_fillrect (struct fb_info *info,const struct fb_fillrect *rect) { -struct neofb_par *par = (struct neofb_par *) info->par; +struct neofb_par *par = info->par;u_long dst, rop; dst = rect->dx + rect->dy * info->var.xres_virtual;
@@ -1440,7 +1440,7 @@ static void neo2200_copyarea(struct fb_info *info, const struct fb_copyarea *area) { u32 sx = area->sx, sy = area->sy, dx = area->dx, dy = area->dy; -struct neofb_par *par = (struct neofb_par *) info->par; +struct neofb_par *par = info->par;u_long src, dst, bltCntl; bltCntl =NEO_BC3_FIFO_EN |NEO_BC3_SKIP_MAPPING |0x0C0000 ;
@@ -1472,7 +1472,7 @@ neo2200_copyarea(struct fb_info *info, cstatic void neo2200_imageblit (struct fb_info *info,const struct fb_image *image) { -struct neofb_par *par = (struct neofb_par *) info->par; +struct neofb_par *par = info->par;int s_pitch = (image->width * image->depth +7 ) >>3 ;int scan_align = info->pixmap.scan_align -1 ;int buf_align = info->pixmap.buf_align -1 ;
@@ -1686,7 +1686,7 @@ static struct fb_videomode __devinitdatastatic int __devinit neo_map_mmio (struct fb_info *info,struct pci_dev *dev) { -struct neofb_par *par = (struct neofb_par *) info->par; +struct neofb_par *par = info->par;DBG ("neo_map_mmio" );
@@ -1733,7 +1733,7 @@ static int __devinit neo_map_mmio(structstatic void neo_unmap_mmio (struct fb_info *info) { -struct neofb_par *par = (struct neofb_par *) info->par; +struct neofb_par *par = info->par;DBG ("neo_unmap_mmio" );
@@ -1796,7 +1796,7 @@ static void neo_unmap_video(struct fb_in#ifdef CONFIG_MTRR { -struct neofb_par *par = (struct neofb_par *) info->par; +struct neofb_par *par = info->par;mtrr_del (par->mtrr, info->fix.smem_start, info->fix.smem_len);
@@ -1811,7 +1811,7 @@ static void neo_unmap_video(struct fb_instatic int __devinit neo_scan_monitor (struct fb_info *info) { -struct neofb_par *par = (struct neofb_par *) info->par; +struct neofb_par *par = info->par;unsigned char type, display;int w;
@@ -1890,7 +1890,7 @@ static int __devinit neo_scan_monitor(ststatic int __devinit neo_init_hw (struct fb_info *info) { -struct neofb_par *par = (struct neofb_par *) info->par; +struct neofb_par *par = info->par;int videoRam =896 ;int maxClock =65000 ;int CursorMem =1024 ;
@@ -2014,7 +2014,7 @@ static struct fb_info *__devinit neo_allstruct fb_info *info;struct neofb_par *par; - info =framebuffer_alloc (sizeof (struct neofb_par ) +sizeof (u32) *256 , &dev->dev); + info =framebuffer_alloc (sizeof (struct neofb_par ), &dev->dev);if (!info)return NULL ;
@@ -2081,7 +2081,7 @@ static struct fb_info *__devinit neo_all info->fix.accel = id->driver_data; info->fbops = &neofb_ops; - info->pseudo_palette = (void *) (par +1 ); + info->pseudo_palette = par->palette;return info; }
include/video/neomagic.h +1 -0
@@ -196,6 +196,7 @@ struct neofb_par {int internal_display;int external_display;int libretto; +u32 palette[16 ]; }; typedef struct {
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click