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: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
parent
57e755d333
commit
161e95b899
@ -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)
|
||||
},
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -338,7 +338,7 @@ static int leo_blank(int blank, struct fb_info *info)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct sbus_mmap_map leo_mmap_map[] = {
|
||||
static const struct sbus_mmap_map leo_mmap_map[] = {
|
||||
{
|
||||
.voff = LEO_SS0_MAP,
|
||||
.poff = LEO_OFF_SS0,
|
||||
|
@ -206,7 +206,7 @@ p9100_blank(int blank, struct fb_info *info)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct sbus_mmap_map p9100_mmap_map[] = {
|
||||
static const struct sbus_mmap_map p9100_mmap_map[] = {
|
||||
{ CG3_MMAP_OFFSET, 0, SBUS_MMAP_FBSIZE(1) },
|
||||
{ 0, 0, 0 }
|
||||
};
|
||||
|
@ -38,7 +38,7 @@ static unsigned long sbusfb_mmapsize(long size, unsigned long fbsize)
|
||||
return fbsize * (-size);
|
||||
}
|
||||
|
||||
int sbusfb_mmap_helper(struct sbus_mmap_map *map,
|
||||
int sbusfb_mmap_helper(const struct sbus_mmap_map *map,
|
||||
unsigned long physbase,
|
||||
unsigned long fbsize,
|
||||
unsigned long iospace,
|
||||
|
@ -19,7 +19,7 @@ struct sbus_mmap_map {
|
||||
|
||||
extern void sbusfb_fill_var(struct fb_var_screeninfo *var,
|
||||
struct device_node *dp, int bpp);
|
||||
extern int sbusfb_mmap_helper(struct sbus_mmap_map *map,
|
||||
extern int sbusfb_mmap_helper(const struct sbus_mmap_map *map,
|
||||
unsigned long physbase, unsigned long fbsize,
|
||||
unsigned long iospace,
|
||||
struct vm_area_struct *vma);
|
||||
|
@ -236,7 +236,7 @@ tcx_blank(int blank, struct fb_info *info)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct sbus_mmap_map __tcx_mmap_map[TCX_MMAP_ENTRIES] = {
|
||||
static const struct sbus_mmap_map __tcx_mmap_map[TCX_MMAP_ENTRIES] = {
|
||||
{
|
||||
.voff = TCX_RAM8BIT,
|
||||
.size = SBUS_MMAP_FBSIZE(1)
|
||||
|
Loading…
Reference in New Issue
Block a user