aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2006-12-08 05:40:31 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:29:06 -0500
commitec1a7b3d7b0c522742c2c4e6e50a5ee2230d4fc6 (patch)
tree7d9a4fa8afa88ce5bd453eea0ed92289869e71d5 /drivers/video
parent4670358a7b5ac1eeec00c1805213d346253b91f6 (diff)
[PATCH] constify vga16fb.c
- move some static data into the .rodata section - simplify source code for transl_l[] and transl_h[] which makes it more readable Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/vga16fb.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c
index 43d5a6d9c4a6..6aff63d5b295 100644
--- a/drivers/video/vga16fb.c
+++ b/drivers/video/vga16fb.c
@@ -264,7 +264,7 @@ static void vga16fb_clock_chip(struct vga16fb_par *par,
264 const struct fb_info *info, 264 const struct fb_info *info,
265 int mul, int div) 265 int mul, int div)
266{ 266{
267 static struct { 267 static const struct {
268 u32 pixclock; 268 u32 pixclock;
269 u8 misc; 269 u8 misc;
270 u8 seq_clock_mode; 270 u8 seq_clock_mode;
@@ -652,7 +652,7 @@ static int vga16fb_set_par(struct fb_info *info)
652 652
653static void ega16_setpalette(int regno, unsigned red, unsigned green, unsigned blue) 653static void ega16_setpalette(int regno, unsigned red, unsigned green, unsigned blue)
654{ 654{
655 static unsigned char map[] = { 000, 001, 010, 011 }; 655 static const unsigned char map[] = { 000, 001, 010, 011 };
656 int val; 656 int val;
657 657
658 if (regno >= 16) 658 if (regno >= 16)
@@ -1139,23 +1139,19 @@ static void vga16fb_copyarea(struct fb_info *info, const struct fb_copyarea *are
1139 } 1139 }
1140} 1140}
1141 1141
1142#ifdef __LITTLE_ENDIAN 1142#define TRANS_MASK_LOW {0x0,0x8,0x4,0xC,0x2,0xA,0x6,0xE,0x1,0x9,0x5,0xD,0x3,0xB,0x7,0xF}
1143static unsigned int transl_l[] = 1143#define TRANS_MASK_HIGH {0x000, 0x800, 0x400, 0xC00, 0x200, 0xA00, 0x600, 0xE00, \
1144{0x0,0x8,0x4,0xC,0x2,0xA,0x6,0xE,0x1,0x9,0x5,0xD,0x3,0xB,0x7,0xF}; 1144 0x100, 0x900, 0x500, 0xD00, 0x300, 0xB00, 0x700, 0xF00}
1145static unsigned int transl_h[] = 1145
1146{0x000, 0x800, 0x400, 0xC00, 0x200, 0xA00, 0x600, 0xE00, 1146#if defined(__LITTLE_ENDIAN)
1147 0x100, 0x900, 0x500, 0xD00, 0x300, 0xB00, 0x700, 0xF00}; 1147static const u16 transl_l[] = TRANS_MASK_LOW;
1148#else 1148static const u16 transl_h[] = TRANS_MASK_HIGH;
1149#ifdef __BIG_ENDIAN 1149#elif defined(__BIG_ENDIAN)
1150static unsigned int transl_h[] = 1150static const u16 transl_l[] = TRANS_MASK_HIGH;
1151{0x0,0x8,0x4,0xC,0x2,0xA,0x6,0xE,0x1,0x9,0x5,0xD,0x3,0xB,0x7,0xF}; 1151static const u16 transl_h[] = TRANS_MASK_LOW;
1152static unsigned int transl_l[] =
1153{0x000, 0x800, 0x400, 0xC00, 0x200, 0xA00, 0x600, 0xE00,
1154 0x100, 0x900, 0x500, 0xD00, 0x300, 0xB00, 0x700, 0xF00};
1155#else 1152#else
1156#error "Only __BIG_ENDIAN and __LITTLE_ENDIAN are supported in vga-planes" 1153#error "Only __BIG_ENDIAN and __LITTLE_ENDIAN are supported in vga-planes"
1157#endif 1154#endif
1158#endif
1159 1155
1160static void vga_8planes_imageblit(struct fb_info *info, const struct fb_image *image) 1156static void vga_8planes_imageblit(struct fb_info *info, const struct fb_image *image)
1161{ 1157{