Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca9384c5 authored by Julia Lawall's avatar Julia Lawall Committed by Tomi Valkeinen
Browse files

video: fbdev: constify fb_fix_screeninfo and fb_var_screeninfo structures

These structures are only used to copy into other structures, so declare
them as const.

The semantic patch that makes this change in the fb_fix_screeninfo case is
as follows (http://coccinelle.lip6.fr/

).  The fb_var_screeninfo case is
analogous.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct fb_fix_screeninfo i@p = { ... };

@ok@
identifier r.i;
expression e;
position p;
@@
e = i@p

@bad@
position p != {r.p,ok.p};
identifier r.i;
struct fb_fix_screeninfo e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct fb_fix_screeninfo i = { ... };
// </smpl>

Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 1d2ffbd3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ struct arcfb_par {
	spinlock_t lock;
};

static struct fb_fix_screeninfo arcfb_fix = {
static const struct fb_fix_screeninfo arcfb_fix = {
	.id =		"arcfb",
	.type =		FB_TYPE_PACKED_PIXELS,
	.visual =	FB_VISUAL_MONO01,
@@ -89,7 +89,7 @@ static struct fb_fix_screeninfo arcfb_fix = {
	.accel =	FB_ACCEL_NONE,
};

static struct fb_var_screeninfo arcfb_var = {
static const struct fb_var_screeninfo arcfb_var = {
	.xres		= 128,
	.yres		= 64,
	.xres_virtual	= 128,
+2 −2
Original line number Diff line number Diff line
@@ -474,7 +474,7 @@ static void chips_hw_init(struct fb_info *p)
		write_fr(chips_init_fr[i].addr, chips_init_fr[i].data);
}

static struct fb_fix_screeninfo asiliantfb_fix = {
static const struct fb_fix_screeninfo asiliantfb_fix = {
	.id =		"Asiliant 69000",
	.type =		FB_TYPE_PACKED_PIXELS,
	.visual =	FB_VISUAL_PSEUDOCOLOR,
@@ -483,7 +483,7 @@ static struct fb_fix_screeninfo asiliantfb_fix = {
	.smem_len =	0x200000,	/* 2MB */
};

static struct fb_var_screeninfo asiliantfb_var = {
static const struct fb_var_screeninfo asiliantfb_var = {
	.xres 		= 640,
	.yres 		= 480,
	.xres_virtual 	= 640,
+3 −3
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@

#ifndef CONFIG_PPC_PMAC
/* default mode */
static struct fb_var_screeninfo default_var = {
static const struct fb_var_screeninfo default_var = {
	/* 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock) */
	640, 480, 640, 480, 0, 0, 8, 0,
	{0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
@@ -104,7 +104,7 @@ static struct fb_var_screeninfo default_var = {
#else /* CONFIG_PPC_PMAC */
/* default to 1024x768 at 75Hz on PPC - this will work
 * on the iMac, the usual 640x480 @ 60Hz doesn't. */
static struct fb_var_screeninfo default_var = {
static const struct fb_var_screeninfo default_var = {
	/* 1024x768, 75 Hz, Non-Interlaced (78.75 MHz dotclock) */
	1024, 768, 1024, 768, 0, 0, 8, 0,
	{0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
@@ -375,7 +375,7 @@ static const struct aty128_meminfo ddr_sgram = {
	.name = "64-bit DDR SGRAM",
};

static struct fb_fix_screeninfo aty128fb_fix = {
static const struct fb_fix_screeninfo aty128fb_fix = {
	.id		= "ATY Rage128",
	.type		= FB_TYPE_PACKED_PIXELS,
	.visual		= FB_VISUAL_PSEUDOCOLOR,
+1 −1
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ struct pci_mmap_map {
	unsigned long prot_mask;
};

static struct fb_fix_screeninfo atyfb_fix = {
static const struct fb_fix_screeninfo atyfb_fix = {
	.id		= "ATY Mach64",
	.type		= FB_TYPE_PACKED_PIXELS,
	.visual		= FB_VISUAL_PSEUDOCOLOR,
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

#include "../edid.h"

static struct fb_var_screeninfo radeonfb_default_var = {
static const struct fb_var_screeninfo radeonfb_default_var = {
	.xres		= 640,
	.yres		= 480,
	.xres_virtual	= 640,
Loading