pm2fb: checkpatch fixes

This patch fixes all errors detected by checkpatch.pl script in the pm2fb.c
file.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Krzysztof Helt 2007-10-16 01:28:50 -07:00 committed by Linus Torvalds
parent 0960bd3db1
commit 3843faa2ca

View file

@ -55,7 +55,8 @@
#undef PM2FB_MASTER_DEBUG #undef PM2FB_MASTER_DEBUG
#ifdef PM2FB_MASTER_DEBUG #ifdef PM2FB_MASTER_DEBUG
#define DPRINTK(a,b...) printk(KERN_DEBUG "pm2fb: %s: " a, __FUNCTION__ , ## b) #define DPRINTK(a, b...) \
printk(KERN_DEBUG "pm2fb: %s: " a, __FUNCTION__ , ## b)
#else #else
#define DPRINTK(a, b...) #define DPRINTK(a, b...)
#endif #endif
@ -65,7 +66,7 @@
/* /*
* Driver data * Driver data
*/ */
static char *mode __devinitdata = NULL; static char *mode __devinitdata;
/* /*
* The XFree GLINT driver will (I think to implement hardware cursor * The XFree GLINT driver will (I think to implement hardware cursor
@ -304,7 +305,8 @@ static void pm2v_mnp(u32 clk, unsigned char* mm, unsigned char* nn,
} }
} }
static void clear_palette(struct pm2fb_par* p) { static void clear_palette(struct pm2fb_par *p)
{
int i = 256; int i = 256;
WAIT_FIFO(p, 1); WAIT_FIFO(p, 1);
@ -428,7 +430,7 @@ static void set_aperture(struct pm2fb_par* p, u32 depth)
} }
#endif #endif
// We don't use aperture two, so this may be superflous /* We don't use aperture two, so this may be superflous */
pm2_WR(p, PM2R_APERTURE_TWO, PM2F_APERTURE_STANDARD); pm2_WR(p, PM2R_APERTURE_TWO, PM2F_APERTURE_STANDARD);
} }
@ -513,7 +515,8 @@ static void set_pixclock(struct pm2fb_par* par, u32 clk)
} }
} }
static void set_video(struct pm2fb_par* p, u32 video) { static void set_video(struct pm2fb_par *p, u32 video)
{
u32 tmp; u32 tmp;
u32 vsync = video; u32 vsync = video;
@ -572,12 +575,14 @@ static int pm2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
} }
if (var->xres != var->xres_virtual) { if (var->xres != var->xres_virtual) {
DPRINTK("virtual x resolution != physical x resolution not supported\n"); DPRINTK("virtual x resolution != "
"physical x resolution not supported\n");
return -EINVAL; return -EINVAL;
} }
if (var->yres > var->yres_virtual) { if (var->yres > var->yres_virtual) {
DPRINTK("virtual y resolution < physical y resolution not possible\n"); DPRINTK("virtual y resolution < "
"physical y resolution not possible\n");
return -EINVAL; return -EINVAL;
} }
@ -611,7 +616,8 @@ static int pm2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
} }
if (PICOS2KHZ(var->pixclock) > PM2_MAX_PIXCLOCK) { if (PICOS2KHZ(var->pixclock) > PM2_MAX_PIXCLOCK) {
DPRINTK("pixclock too high (%ldKHz)\n", PICOS2KHZ(var->pixclock)); DPRINTK("pixclock too high (%ldKHz)\n",
PICOS2KHZ(var->pixclock));
return -EINVAL; return -EINVAL;
} }
@ -619,7 +625,9 @@ static int pm2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
var->transp.length = 0; var->transp.length = 0;
switch (var->bits_per_pixel) { switch (var->bits_per_pixel) {
case 8: case 8:
var->red.length = var->green.length = var->blue.length = 8; var->red.length = 8;
var->green.length = 8;
var->blue.length = 8;
break; break;
case 16: case 16:
var->red.offset = 11; var->red.offset = 11;
@ -635,7 +643,9 @@ static int pm2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
var->red.offset = 16; var->red.offset = 16;
var->green.offset = 8; var->green.offset = 8;
var->blue.offset = 0; var->blue.offset = 0;
var->red.length = var->green.length = var->blue.length = 8; var->red.length = 8;
var->green.length = 8;
var->blue.length = 8;
break; break;
case 24: case 24:
#ifdef __BIG_ENDIAN #ifdef __BIG_ENDIAN
@ -646,10 +656,13 @@ static int pm2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
var->blue.offset = 0; var->blue.offset = 0;
#endif #endif
var->green.offset = 8; var->green.offset = 8;
var->red.length = var->green.length = var->blue.length = 8; var->red.length = 8;
var->green.length = 8;
var->blue.length = 8;
break; break;
} }
var->height = var->width = -1; var->height = -1;
var->width = -1;
var->accel_flags = 0; /* Can't mmap if this is on */ var->accel_flags = 0; /* Can't mmap if this is on */
@ -708,7 +721,8 @@ static int pm2fb_set_par(struct fb_info *info)
? info->var.lower_margin - 1 ? info->var.lower_margin - 1
: 0; /* FIXME! */ : 0; /* FIXME! */
vsend = info->var.lower_margin + info->var.vsync_len - 1; vsend = info->var.lower_margin + info->var.vsync_len - 1;
vbend = info->var.lower_margin + info->var.vsync_len + info->var.upper_margin; vbend = info->var.lower_margin + info->var.vsync_len +
info->var.upper_margin;
vtotal = info->var.yres + vbend - 1; vtotal = info->var.yres + vbend - 1;
stride = to3264(width, depth, 1); stride = to3264(width, depth, 1);
base = to3264(info->var.yoffset * xres + info->var.xoffset, depth, 1); base = to3264(info->var.yoffset * xres + info->var.xoffset, depth, 1);
@ -721,18 +735,18 @@ static int pm2fb_set_par(struct fb_info *info)
video |= PM2F_HSYNC_ACT_LOW; video |= PM2F_HSYNC_ACT_LOW;
} else } else
video |= PM2F_HSYNC_ACT_HIGH; video |= PM2F_HSYNC_ACT_HIGH;
} } else
else
video |= PM2F_HSYNC_ACT_LOW; video |= PM2F_HSYNC_ACT_LOW;
if (info->var.sync & FB_SYNC_VERT_HIGH_ACT) { if (info->var.sync & FB_SYNC_VERT_HIGH_ACT) {
if (lowvsync) { if (lowvsync) {
DPRINTK("ignoring +vsync, using -vsync.\n"); DPRINTK("ignoring +vsync, using -vsync.\n");
video |= PM2F_VSYNC_ACT_LOW; video |= PM2F_VSYNC_ACT_LOW;
} else } else
video |= PM2F_VSYNC_ACT_HIGH; video |= PM2F_VSYNC_ACT_HIGH;
} } else
else
video |= PM2F_VSYNC_ACT_LOW; video |= PM2F_VSYNC_ACT_LOW;
if ((info->var.vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) { if ((info->var.vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
DPRINTK("interlaced not supported\n"); DPRINTK("interlaced not supported\n");
return -EINVAL; return -EINVAL;
@ -861,10 +875,9 @@ static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green,
*/ */
/* grayscale works only partially under directcolor */ /* grayscale works only partially under directcolor */
if (info->var.grayscale) {
/* grayscale = 0.30*R + 0.59*G + 0.11*B */ /* grayscale = 0.30*R + 0.59*G + 0.11*B */
if (info->var.grayscale)
red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8; red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
}
/* Directcolor: /* Directcolor:
* var->{color}.offset contains start of bitfield * var->{color}.offset contains start of bitfield
@ -931,8 +944,7 @@ static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green,
break; break;
} }
return 0; return 0;
} } else if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR)
else if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR)
set_color(par, regno, red, green, blue); set_color(par, regno, red, green, blue);
return 0; return 0;
@ -1082,7 +1094,8 @@ static void pm2fb_fillrect (struct fb_info *info,
pm2_WR(par, PM2R_CONSTANT_COLOR, color); pm2_WR(par, PM2R_CONSTANT_COLOR, color);
wmb(); wmb();
pm2_WR(par, PM2R_RENDER, pm2_WR(par, PM2R_RENDER,
PM2F_RENDER_RECTANGLE | PM2F_INCREASE_X | PM2F_INCREASE_Y ); PM2F_RENDER_RECTANGLE |
PM2F_INCREASE_X | PM2F_INCREASE_Y );
pm2_WR(par, PM2R_COLOR_DDA_MODE, 0); pm2_WR(par, PM2R_COLOR_DDA_MODE, 0);
} }
} }
@ -1269,7 +1282,8 @@ static int __devinit pm2fb_probe(struct pci_dev *pdev,
{ {
struct pm2fb_par *default_par; struct pm2fb_par *default_par;
struct fb_info *info; struct fb_info *info;
int err, err_retval = -ENXIO; int err;
int retval = -ENXIO;
err = pci_enable_device(pdev); err = pci_enable_device(pdev);
if (err) { if (err) {
@ -1342,19 +1356,21 @@ static int __devinit pm2fb_probe(struct pci_dev *pdev,
default_par->mem_config = 0xe6002021; default_par->mem_config = 0xe6002021;
if (pdev->subsystem_vendor == 0x1048 && if (pdev->subsystem_vendor == 0x1048 &&
pdev->subsystem_device == 0x0a31) { pdev->subsystem_device == 0x0a31) {
DPRINTK("subsystem_vendor: %04x, subsystem_device: %04x\n", DPRINTK("subsystem_vendor: %04x, "
"subsystem_device: %04x\n",
pdev->subsystem_vendor, pdev->subsystem_device); pdev->subsystem_vendor, pdev->subsystem_device);
DPRINTK("We have not been initialized by VGA BIOS " DPRINTK("We have not been initialized by VGA BIOS and "
"and are running on an Elsa Winner 2000 Office\n"); "are running on an Elsa Winner 2000 Office\n");
DPRINTK("Initializing card timings manually...\n"); DPRINTK("Initializing card timings manually...\n");
default_par->memclock = 100000; default_par->memclock = 100000;
} }
if (pdev->subsystem_vendor == 0x3d3d && if (pdev->subsystem_vendor == 0x3d3d &&
pdev->subsystem_device == 0x0100) { pdev->subsystem_device == 0x0100) {
DPRINTK("subsystem_vendor: %04x, subsystem_device: %04x\n", DPRINTK("subsystem_vendor: %04x, "
"subsystem_device: %04x\n",
pdev->subsystem_vendor, pdev->subsystem_device); pdev->subsystem_vendor, pdev->subsystem_device);
DPRINTK("We have not been initialized by VGA BIOS " DPRINTK("We have not been initialized by VGA BIOS and "
"and are running on an 3dlabs reference board\n"); "are running on an 3dlabs reference board\n");
DPRINTK("Initializing card timings manually...\n"); DPRINTK("Initializing card timings manually...\n");
default_par->memclock = 74894; default_par->memclock = 74894;
} }
@ -1411,7 +1427,7 @@ static int __devinit pm2fb_probe(struct pci_dev *pdev,
info->pixmap.addr = kmalloc(PM2_PIXMAP_SIZE, GFP_KERNEL); info->pixmap.addr = kmalloc(PM2_PIXMAP_SIZE, GFP_KERNEL);
if (!info->pixmap.addr) { if (!info->pixmap.addr) {
err_retval = -ENOMEM; retval = -ENOMEM;
goto err_exit_pixmap; goto err_exit_pixmap;
} }
info->pixmap.size = PM2_PIXMAP_SIZE; info->pixmap.size = PM2_PIXMAP_SIZE;
@ -1461,7 +1477,7 @@ static int __devinit pm2fb_probe(struct pci_dev *pdev,
release_mem_region(pm2fb_fix.mmio_start, pm2fb_fix.mmio_len); release_mem_region(pm2fb_fix.mmio_start, pm2fb_fix.mmio_len);
err_exit_neither: err_exit_neither:
framebuffer_release(info); framebuffer_release(info);
return err_retval; return retval;
} }
/** /**
@ -1490,7 +1506,6 @@ static void __devexit pm2fb_remove(struct pci_dev *pdev)
release_mem_region(fix->mmio_start, fix->mmio_len); release_mem_region(fix->mmio_start, fix->mmio_len);
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
if (info->pixmap.addr)
kfree(info->pixmap.addr); kfree(info->pixmap.addr);
kfree(info); kfree(info);
} }
@ -1531,20 +1546,19 @@ static int __init pm2fb_setup(char *options)
while ((this_opt = strsep(&options, ",")) != NULL) { while ((this_opt = strsep(&options, ",")) != NULL) {
if (!*this_opt) if (!*this_opt)
continue; continue;
if (!strcmp(this_opt, "lowhsync")) { if (!strcmp(this_opt, "lowhsync"))
lowhsync = 1; lowhsync = 1;
} else if (!strcmp(this_opt, "lowvsync")) { else if (!strcmp(this_opt, "lowvsync"))
lowvsync = 1; lowvsync = 1;
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
} else if (!strncmp(this_opt, "nomtrr", 6)) { else if (!strncmp(this_opt, "nomtrr", 6))
nomtrr = 1; nomtrr = 1;
#endif #endif
} else if (!strncmp(this_opt, "noaccel", 7)) { else if (!strncmp(this_opt, "noaccel", 7))
noaccel = 1; noaccel = 1;
} else { else
mode = this_opt; mode = this_opt;
} }
}
return 0; return 0;
} }
#endif #endif