Commit 161e95b8 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Helge Deller
Browse files

fbdev: Constify struct sbus_mmap_map



'struct sbus_mmap_map' are not modified in these drivers.

Constifying this structure moves some data to a read-only section, so
increases overall security.

Update sbusfb_mmap_helper() accordingly.

On a x86_64, with allmodconfig, as an example:
Before:
======
   text	   data	    bss	    dec	    hex	filename
   2452	    536	     16	   3004	    bbc	drivers/video/fbdev/bw2.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
   2500	    483	     16	   2999	    bb7	drivers/video/fbdev/bw2.o

Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 57e755d3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ bw2_blank(int blank, struct fb_info *info)
	return 0;
}

static struct sbus_mmap_map bw2_mmap_map[] = {
static const struct sbus_mmap_map bw2_mmap_map[] = {
	{
		.size = SBUS_MMAP_FBSIZE(1)
	},
+1 −1
Original line number Diff line number Diff line
@@ -360,7 +360,7 @@ static void cg14_init_fix(struct fb_info *info, int linebytes,
	info->fix.accel = FB_ACCEL_SUN_CG14;
}

static struct sbus_mmap_map __cg14_mmap_map[CG14_MMAP_ENTRIES] = {
static const struct sbus_mmap_map __cg14_mmap_map[CG14_MMAP_ENTRIES] = {
	{
		.voff	= CG14_REGS,
		.poff	= 0x80000000,
+1 −1
Original line number Diff line number Diff line
@@ -209,7 +209,7 @@ static int cg3_blank(int blank, struct fb_info *info)
	return 0;
}

static struct sbus_mmap_map cg3_mmap_map[] = {
static const struct sbus_mmap_map cg3_mmap_map[] = {
	{
		.voff	= CG3_MMAP_OFFSET,
		.poff	= CG3_RAM_OFFSET,
+1 −1
Original line number Diff line number Diff line
@@ -545,7 +545,7 @@ static int cg6_blank(int blank, struct fb_info *info)
	return 0;
}

static struct sbus_mmap_map cg6_mmap_map[] = {
static const struct sbus_mmap_map cg6_mmap_map[] = {
	{
		.voff	= CG6_FBC,
		.poff	= CG6_FBC_OFFSET,
+1 −1
Original line number Diff line number Diff line
@@ -710,7 +710,7 @@ static int ffb_blank(int blank, struct fb_info *info)
	return 0;
}

static struct sbus_mmap_map ffb_mmap_map[] = {
static const struct sbus_mmap_map ffb_mmap_map[] = {
	{
		.voff	= FFB_SFB8R_VOFF,
		.poff	= FFB_SFB8R_POFF,
Loading