aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/aty
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/aty')
-rw-r--r--drivers/video/aty/aty128fb.c4
-rw-r--r--drivers/video/aty/atyfb_base.c16
-rw-r--r--drivers/video/aty/mach64_gx.c3
-rw-r--r--drivers/video/aty/radeon_base.c6
4 files changed, 15 insertions, 14 deletions
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index 620c9a934e0e..821c6da8e42c 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -1725,9 +1725,9 @@ static int __init aty128_init(struct pci_dev *pdev, const struct pci_device_id *
1725 strcpy(video_card, "Rage128 XX "); 1725 strcpy(video_card, "Rage128 XX ");
1726 video_card[8] = ent->device >> 8; 1726 video_card[8] = ent->device >> 8;
1727 video_card[9] = ent->device & 0xFF; 1727 video_card[9] = ent->device & 0xFF;
1728 1728
1729 /* range check to make sure */ 1729 /* range check to make sure */
1730 if (ent->driver_data < (sizeof(r128_family)/sizeof(char *))) 1730 if (ent->driver_data < ARRAY_SIZE(r128_family))
1731 strncat(video_card, r128_family[ent->driver_data], sizeof(video_card)); 1731 strncat(video_card, r128_family[ent->driver_data], sizeof(video_card));
1732 1732
1733 printk(KERN_INFO "aty128fb: %s [chip rev 0x%x] ", video_card, chip_rev); 1733 printk(KERN_INFO "aty128fb: %s [chip rev 0x%x] ", video_card, chip_rev);
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 485be386a8ff..e799fcca365a 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -434,7 +434,7 @@ static int __devinit correct_chipset(struct atyfb_par *par)
434 const char *name; 434 const char *name;
435 int i; 435 int i;
436 436
437 for (i = sizeof(aty_chips) / sizeof(*aty_chips) - 1; i >= 0; i--) 437 for (i = ARRAY_SIZE(aty_chips) - 1; i >= 0; i--)
438 if (par->pci_id == aty_chips[i].pci_id) 438 if (par->pci_id == aty_chips[i].pci_id)
439 break; 439 break;
440 440
@@ -2168,10 +2168,10 @@ static void __init aty_calc_mem_refresh(struct atyfb_par *par, int xclk)
2168 2168
2169 if (IS_XL(par->pci_id) || IS_MOBILITY(par->pci_id)) { 2169 if (IS_XL(par->pci_id) || IS_MOBILITY(par->pci_id)) {
2170 refresh_tbl = ragexl_tbl; 2170 refresh_tbl = ragexl_tbl;
2171 size = sizeof(ragexl_tbl)/sizeof(int); 2171 size = ARRAY_SIZE(ragexl_tbl);
2172 } else { 2172 } else {
2173 refresh_tbl = ragepro_tbl; 2173 refresh_tbl = ragepro_tbl;
2174 size = sizeof(ragepro_tbl)/sizeof(int); 2174 size = ARRAY_SIZE(ragepro_tbl);
2175 } 2175 }
2176 2176
2177 for (i=0; i < size; i++) { 2177 for (i=0; i < size; i++) {
@@ -2298,6 +2298,10 @@ static int __init aty_init(struct fb_info *info, const char *name)
2298 case CLK_ATI18818_1: 2298 case CLK_ATI18818_1:
2299 par->pll_ops = &aty_pll_ati18818_1; 2299 par->pll_ops = &aty_pll_ati18818_1;
2300 break; 2300 break;
2301 case CLK_IBMRGB514:
2302 par->pll_ops = &aty_pll_ibm514;
2303 break;
2304#if 0 /* dead code */
2301 case CLK_STG1703: 2305 case CLK_STG1703:
2302 par->pll_ops = &aty_pll_stg1703; 2306 par->pll_ops = &aty_pll_stg1703;
2303 break; 2307 break;
@@ -2307,9 +2311,7 @@ static int __init aty_init(struct fb_info *info, const char *name)
2307 case CLK_ATT20C408: 2311 case CLK_ATT20C408:
2308 par->pll_ops = &aty_pll_att20c408; 2312 par->pll_ops = &aty_pll_att20c408;
2309 break; 2313 break;
2310 case CLK_IBMRGB514: 2314#endif
2311 par->pll_ops = &aty_pll_ibm514;
2312 break;
2313 default: 2315 default:
2314 PRINTKI("aty_init: CLK type not implemented yet!"); 2316 PRINTKI("aty_init: CLK type not implemented yet!");
2315 par->pll_ops = &aty_pll_unsupported; 2317 par->pll_ops = &aty_pll_unsupported;
@@ -3397,7 +3399,7 @@ static int __devinit atyfb_pci_probe(struct pci_dev *pdev, const struct pci_devi
3397 struct atyfb_par *par; 3399 struct atyfb_par *par;
3398 int i, rc = -ENOMEM; 3400 int i, rc = -ENOMEM;
3399 3401
3400 for (i = sizeof(aty_chips) / sizeof(*aty_chips) - 1; i >= 0; i--) 3402 for (i = ARRAY_SIZE(aty_chips); i >= 0; i--)
3401 if (pdev->device == aty_chips[i].pci_id) 3403 if (pdev->device == aty_chips[i].pci_id)
3402 break; 3404 break;
3403 3405
diff --git a/drivers/video/aty/mach64_gx.c b/drivers/video/aty/mach64_gx.c
index 01fdff79483b..2045639cb671 100644
--- a/drivers/video/aty/mach64_gx.c
+++ b/drivers/video/aty/mach64_gx.c
@@ -149,8 +149,7 @@ static int aty_var_to_pll_514(const struct fb_info *info, u32 vclk_per,
149 }; 149 };
150 int i; 150 int i;
151 151
152 for (i = 0; i < sizeof(RGB514_clocks) / sizeof(*RGB514_clocks); 152 for (i = 0; i < ARRAY_SIZE(RGB514_clocks); i++)
153 i++)
154 if (vclk_per <= RGB514_clocks[i].limit) { 153 if (vclk_per <= RGB514_clocks[i].limit) {
155 pll->ibm514.m = RGB514_clocks[i].m; 154 pll->ibm514.m = RGB514_clocks[i].m;
156 pll->ibm514.n = RGB514_clocks[i].n; 155 pll->ibm514.n = RGB514_clocks[i].n;
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index c9f0c5a07e6e..9a6b5b39b88e 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -1067,7 +1067,7 @@ static int radeon_setcolreg (unsigned regno, unsigned red, unsigned green,
1067 1067
1068 1068
1069 if (regno > 255) 1069 if (regno > 255)
1070 return 1; 1070 return -EINVAL;
1071 1071
1072 red >>= 8; 1072 red >>= 8;
1073 green >>= 8; 1073 green >>= 8;
@@ -1086,9 +1086,9 @@ static int radeon_setcolreg (unsigned regno, unsigned red, unsigned green,
1086 pindex = regno * 8; 1086 pindex = regno * 8;
1087 1087
1088 if (rinfo->depth == 16 && regno > 63) 1088 if (rinfo->depth == 16 && regno > 63)
1089 return 1; 1089 return -EINVAL;
1090 if (rinfo->depth == 15 && regno > 31) 1090 if (rinfo->depth == 15 && regno > 31)
1091 return 1; 1091 return -EINVAL;
1092 1092
1093 /* For 565, the green component is mixed one order 1093 /* For 565, the green component is mixed one order
1094 * below 1094 * below