diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2014-08-23 07:20:24 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-08-26 08:52:38 -0400 |
commit | 1287c5bf214b906d64a71c481545010dbe1b5b66 (patch) | |
tree | 76a581691779ce48d75b7e51dbe9cc3506b2acfa /drivers/video | |
parent | 68ecfe2fe2e6c636bb7e2cf616e658e342e05362 (diff) |
video: fbdev: matrox: use c99 initializers in structures
Use c99 initializers for structures.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@decl@
identifier i1,fld;
type T;
field list[n] fs;
@@
struct i1 {
fs
T fld;
...};
@bad@
identifier decl.i1,i2;
expression e;
initializer list[decl.n] is;
@@
struct i1 i2 = { is,
+ .fld = e
- e
,...};
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fbdev/matrox/matroxfb_base.c | 52 | ||||
-rw-r--r-- | drivers/video/fbdev/matrox/matroxfb_maven.c | 20 |
2 files changed, 56 insertions, 16 deletions
diff --git a/drivers/video/fbdev/matrox/matroxfb_base.c b/drivers/video/fbdev/matrox/matroxfb_base.c index 7116c5309c7d..62539ca1cfa9 100644 --- a/drivers/video/fbdev/matrox/matroxfb_base.c +++ b/drivers/video/fbdev/matrox/matroxfb_base.c | |||
@@ -1341,19 +1341,57 @@ struct video_board { | |||
1341 | struct matrox_switch* lowlevel; | 1341 | struct matrox_switch* lowlevel; |
1342 | }; | 1342 | }; |
1343 | #ifdef CONFIG_FB_MATROX_MILLENIUM | 1343 | #ifdef CONFIG_FB_MATROX_MILLENIUM |
1344 | static struct video_board vbMillennium = {0x0800000, 0x0800000, FB_ACCEL_MATROX_MGA2064W, &matrox_millennium}; | 1344 | static struct video_board vbMillennium = { |
1345 | static struct video_board vbMillennium2 = {0x1000000, 0x0800000, FB_ACCEL_MATROX_MGA2164W, &matrox_millennium}; | 1345 | .maxvram = 0x0800000, |
1346 | static struct video_board vbMillennium2A = {0x1000000, 0x0800000, FB_ACCEL_MATROX_MGA2164W_AGP, &matrox_millennium}; | 1346 | .maxdisplayable = 0x0800000, |
1347 | .accelID = FB_ACCEL_MATROX_MGA2064W, | ||
1348 | .lowlevel = &matrox_millennium | ||
1349 | }; | ||
1350 | |||
1351 | static struct video_board vbMillennium2 = { | ||
1352 | .maxvram = 0x1000000, | ||
1353 | .maxdisplayable = 0x0800000, | ||
1354 | .accelID = FB_ACCEL_MATROX_MGA2164W, | ||
1355 | .lowlevel = &matrox_millennium | ||
1356 | }; | ||
1357 | |||
1358 | static struct video_board vbMillennium2A = { | ||
1359 | .maxvram = 0x1000000, | ||
1360 | .maxdisplayable = 0x0800000, | ||
1361 | .accelID = FB_ACCEL_MATROX_MGA2164W_AGP, | ||
1362 | .lowlevel = &matrox_millennium | ||
1363 | }; | ||
1347 | #endif /* CONFIG_FB_MATROX_MILLENIUM */ | 1364 | #endif /* CONFIG_FB_MATROX_MILLENIUM */ |
1348 | #ifdef CONFIG_FB_MATROX_MYSTIQUE | 1365 | #ifdef CONFIG_FB_MATROX_MYSTIQUE |
1349 | static struct video_board vbMystique = {0x0800000, 0x0800000, FB_ACCEL_MATROX_MGA1064SG, &matrox_mystique}; | 1366 | static struct video_board vbMystique = { |
1367 | .maxvram = 0x0800000, | ||
1368 | .maxdisplayable = 0x0800000, | ||
1369 | .accelID = FB_ACCEL_MATROX_MGA1064SG, | ||
1370 | .lowlevel = &matrox_mystique | ||
1371 | }; | ||
1350 | #endif /* CONFIG_FB_MATROX_MYSTIQUE */ | 1372 | #endif /* CONFIG_FB_MATROX_MYSTIQUE */ |
1351 | #ifdef CONFIG_FB_MATROX_G | 1373 | #ifdef CONFIG_FB_MATROX_G |
1352 | static struct video_board vbG100 = {0x0800000, 0x0800000, FB_ACCEL_MATROX_MGAG100, &matrox_G100}; | 1374 | static struct video_board vbG100 = { |
1353 | static struct video_board vbG200 = {0x1000000, 0x1000000, FB_ACCEL_MATROX_MGAG200, &matrox_G100}; | 1375 | .maxvram = 0x0800000, |
1376 | .maxdisplayable = 0x0800000, | ||
1377 | .accelID = FB_ACCEL_MATROX_MGAG100, | ||
1378 | .lowlevel = &matrox_G100 | ||
1379 | }; | ||
1380 | |||
1381 | static struct video_board vbG200 = { | ||
1382 | .maxvram = 0x1000000, | ||
1383 | .maxdisplayable = 0x1000000, | ||
1384 | .accelID = FB_ACCEL_MATROX_MGAG200, | ||
1385 | .lowlevel = &matrox_G100 | ||
1386 | }; | ||
1354 | /* from doc it looks like that accelerator can draw only to low 16MB :-( Direct accesses & displaying are OK for | 1387 | /* from doc it looks like that accelerator can draw only to low 16MB :-( Direct accesses & displaying are OK for |
1355 | whole 32MB */ | 1388 | whole 32MB */ |
1356 | static struct video_board vbG400 = {0x2000000, 0x1000000, FB_ACCEL_MATROX_MGAG400, &matrox_G100}; | 1389 | static struct video_board vbG400 = { |
1390 | .maxvram = 0x2000000, | ||
1391 | .maxdisplayable = 0x1000000, | ||
1392 | .accelID = FB_ACCEL_MATROX_MGAG400, | ||
1393 | .lowlevel = &matrox_G100 | ||
1394 | }; | ||
1357 | #endif | 1395 | #endif |
1358 | 1396 | ||
1359 | #define DEVF_VIDEO64BIT 0x0001 | 1397 | #define DEVF_VIDEO64BIT 0x0001 |
diff --git a/drivers/video/fbdev/matrox/matroxfb_maven.c b/drivers/video/fbdev/matrox/matroxfb_maven.c index ee41a0f276b2..bf5ce04f9aea 100644 --- a/drivers/video/fbdev/matrox/matroxfb_maven.c +++ b/drivers/video/fbdev/matrox/matroxfb_maven.c | |||
@@ -201,21 +201,23 @@ struct matrox_pll_ctl { | |||
201 | }; | 201 | }; |
202 | 202 | ||
203 | static const struct matrox_pll_features2 maven1000_pll = { | 203 | static const struct matrox_pll_features2 maven1000_pll = { |
204 | 50000000, | 204 | .vco_freq_min = 50000000, |
205 | 300000000, | 205 | .vco_freq_max = 300000000, |
206 | 5, 128, | 206 | .feed_div_min = 5, |
207 | 3, 32, | 207 | .feed_div_max = 128, |
208 | 3 | 208 | .in_div_min = 3, |
209 | .in_div_max = 32, | ||
210 | .post_shift_max = 3 | ||
209 | }; | 211 | }; |
210 | 212 | ||
211 | static const struct matrox_pll_ctl maven_PAL = { | 213 | static const struct matrox_pll_ctl maven_PAL = { |
212 | 540000, | 214 | .ref_freq = 540000, |
213 | 50 | 215 | .den = 50 |
214 | }; | 216 | }; |
215 | 217 | ||
216 | static const struct matrox_pll_ctl maven_NTSC = { | 218 | static const struct matrox_pll_ctl maven_NTSC = { |
217 | 450450, /* 27027000/60 == 27000000/59.94005994 */ | 219 | .ref_freq = 450450, /* 27027000/60 == 27000000/59.94005994 */ |
218 | 60 | 220 | .den = 60 |
219 | }; | 221 | }; |
220 | 222 | ||
221 | static int matroxfb_PLL_mavenclock(const struct matrox_pll_features2* pll, | 223 | static int matroxfb_PLL_mavenclock(const struct matrox_pll_features2* pll, |