[PATCH 2/4] drm: Constify struct drm_fb_helper_funcs
From: Thierry Reding There's no need for this to be modifiable. Make it const so that it can be put into the .rodata section. Signed-off-by: Thierry Reding --- drivers/gpu/drm/armada/armada_fbdev.c | 2 +- drivers/gpu/drm/ast/ast_fb.c | 2 +- drivers/gpu/drm/bochs/bochs_fbdev.c | 2 +- drivers/gpu/drm/cirrus/cirrus_fbdev.c | 2 +- drivers/gpu/drm/drm_fb_cma_helper.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 2 +- drivers/gpu/drm/gma500/framebuffer.c | 2 +- drivers/gpu/drm/i915/intel_fbdev.c| 2 +- drivers/gpu/drm/mgag200/mgag200_fb.c | 2 +- drivers/gpu/drm/msm/msm_fbdev.c | 2 +- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 2 +- drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +- drivers/gpu/drm/qxl/qxl_fb.c | 2 +- drivers/gpu/drm/radeon/radeon_fb.c| 2 +- drivers/gpu/drm/tegra/fb.c| 2 +- drivers/gpu/drm/udl/udl_fb.c | 2 +- include/drm/drm_fb_helper.h | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/armada/armada_fbdev.c b/drivers/gpu/drm/armada/armada_fbdev.c index 948cb14c561e..21aa1261dba2 100644 --- a/drivers/gpu/drm/armada/armada_fbdev.c +++ b/drivers/gpu/drm/armada/armada_fbdev.c @@ -131,7 +131,7 @@ static int armada_fb_probe(struct drm_fb_helper *fbh, return ret; } -static struct drm_fb_helper_funcs armada_fb_helper_funcs = { +static const struct drm_fb_helper_funcs armada_fb_helper_funcs = { .gamma_set = armada_drm_crtc_gamma_set, .gamma_get = armada_drm_crtc_gamma_get, .fb_probe = armada_fb_probe, diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c index a28640f47c27..2113894e4ff8 100644 --- a/drivers/gpu/drm/ast/ast_fb.c +++ b/drivers/gpu/drm/ast/ast_fb.c @@ -287,7 +287,7 @@ static void ast_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, *blue = ast_crtc->lut_b[regno] << 8; } -static struct drm_fb_helper_funcs ast_fb_helper_funcs = { +static const struct drm_fb_helper_funcs ast_fb_helper_funcs = { .gamma_set = ast_fb_gamma_set, .gamma_get = ast_fb_gamma_get, .fb_probe = astfb_create, diff --git a/drivers/gpu/drm/bochs/bochs_fbdev.c b/drivers/gpu/drm/bochs/bochs_fbdev.c index 561b84474122..17e5c17f2730 100644 --- a/drivers/gpu/drm/bochs/bochs_fbdev.c +++ b/drivers/gpu/drm/bochs/bochs_fbdev.c @@ -179,7 +179,7 @@ void bochs_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, *blue = regno; } -static struct drm_fb_helper_funcs bochs_fb_helper_funcs = { +static const struct drm_fb_helper_funcs bochs_fb_helper_funcs = { .gamma_set = bochs_fb_gamma_set, .gamma_get = bochs_fb_gamma_get, .fb_probe = bochsfb_create, diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c b/drivers/gpu/drm/cirrus/cirrus_fbdev.c index 32bbba0a787b..2bd0291168e4 100644 --- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c +++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c @@ -288,7 +288,7 @@ static int cirrus_fbdev_destroy(struct drm_device *dev, return 0; } -static struct drm_fb_helper_funcs cirrus_fb_helper_funcs = { +static const struct drm_fb_helper_funcs cirrus_fb_helper_funcs = { .gamma_set = cirrus_crtc_fb_gamma_set, .gamma_get = cirrus_crtc_fb_gamma_get, .fb_probe = cirrusfb_create, diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c index 61b5a47ad239..b74f9e58b69d 100644 --- a/drivers/gpu/drm/drm_fb_cma_helper.c +++ b/drivers/gpu/drm/drm_fb_cma_helper.c @@ -327,7 +327,7 @@ err_drm_gem_cma_free_object: return ret; } -static struct drm_fb_helper_funcs drm_fb_cma_helper_funcs = { +static const struct drm_fb_helper_funcs drm_fb_cma_helper_funcs = { .fb_probe = drm_fbdev_cma_create, }; diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index addbf7536da4..7ccf04917f47 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c @@ -233,7 +233,7 @@ out: return ret; } -static struct drm_fb_helper_funcs exynos_drm_fb_helper_funcs = { +static const struct drm_fb_helper_funcs exynos_drm_fb_helper_funcs = { .fb_probe = exynos_drm_fbdev_create, }; diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index e7fcc148f333..76e4d777d01d 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c @@ -561,7 +561,7 @@ static int psbfb_probe(struct drm_fb_helper *helper, return psbfb_create(psb_fbdev, sizes); } -static struct drm_fb_helper_funcs psb_fb_helper_funcs = { +static const struct drm_fb_helper_funcs psb_fb_helper_funcs = { .gamma_set = psbfb_gamma_set, .gamma_get = psbfb_gamma_get, .fb_probe = psbfb_probe, diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c index b
Re: [PATCH 2/4] drm: Constify struct drm_fb_helper_funcs
On Tue, Apr 22, 2014 at 04:42:19PM +0200, Thierry Reding wrote: > From: Thierry Reding > > There's no need for this to be modifiable. Make it const so that it can > be put into the .rodata section. > > Signed-off-by: Thierry Reding Reviewed-by: Daniel Vetter > --- > drivers/gpu/drm/armada/armada_fbdev.c | 2 +- > drivers/gpu/drm/ast/ast_fb.c | 2 +- > drivers/gpu/drm/bochs/bochs_fbdev.c | 2 +- > drivers/gpu/drm/cirrus/cirrus_fbdev.c | 2 +- > drivers/gpu/drm/drm_fb_cma_helper.c | 2 +- > drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 2 +- > drivers/gpu/drm/gma500/framebuffer.c | 2 +- > drivers/gpu/drm/i915/intel_fbdev.c| 2 +- > drivers/gpu/drm/mgag200/mgag200_fb.c | 2 +- > drivers/gpu/drm/msm/msm_fbdev.c | 2 +- > drivers/gpu/drm/nouveau/nouveau_fbcon.c | 2 +- > drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +- > drivers/gpu/drm/qxl/qxl_fb.c | 2 +- > drivers/gpu/drm/radeon/radeon_fb.c| 2 +- > drivers/gpu/drm/tegra/fb.c| 2 +- > drivers/gpu/drm/udl/udl_fb.c | 2 +- > include/drm/drm_fb_helper.h | 2 +- > 17 files changed, 17 insertions(+), 17 deletions(-) > > diff --git a/drivers/gpu/drm/armada/armada_fbdev.c > b/drivers/gpu/drm/armada/armada_fbdev.c > index 948cb14c561e..21aa1261dba2 100644 > --- a/drivers/gpu/drm/armada/armada_fbdev.c > +++ b/drivers/gpu/drm/armada/armada_fbdev.c > @@ -131,7 +131,7 @@ static int armada_fb_probe(struct drm_fb_helper *fbh, > return ret; > } > > -static struct drm_fb_helper_funcs armada_fb_helper_funcs = { > +static const struct drm_fb_helper_funcs armada_fb_helper_funcs = { > .gamma_set = armada_drm_crtc_gamma_set, > .gamma_get = armada_drm_crtc_gamma_get, > .fb_probe = armada_fb_probe, > diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c > index a28640f47c27..2113894e4ff8 100644 > --- a/drivers/gpu/drm/ast/ast_fb.c > +++ b/drivers/gpu/drm/ast/ast_fb.c > @@ -287,7 +287,7 @@ static void ast_fb_gamma_get(struct drm_crtc *crtc, u16 > *red, u16 *green, > *blue = ast_crtc->lut_b[regno] << 8; > } > > -static struct drm_fb_helper_funcs ast_fb_helper_funcs = { > +static const struct drm_fb_helper_funcs ast_fb_helper_funcs = { > .gamma_set = ast_fb_gamma_set, > .gamma_get = ast_fb_gamma_get, > .fb_probe = astfb_create, > diff --git a/drivers/gpu/drm/bochs/bochs_fbdev.c > b/drivers/gpu/drm/bochs/bochs_fbdev.c > index 561b84474122..17e5c17f2730 100644 > --- a/drivers/gpu/drm/bochs/bochs_fbdev.c > +++ b/drivers/gpu/drm/bochs/bochs_fbdev.c > @@ -179,7 +179,7 @@ void bochs_fb_gamma_get(struct drm_crtc *crtc, u16 *red, > u16 *green, > *blue = regno; > } > > -static struct drm_fb_helper_funcs bochs_fb_helper_funcs = { > +static const struct drm_fb_helper_funcs bochs_fb_helper_funcs = { > .gamma_set = bochs_fb_gamma_set, > .gamma_get = bochs_fb_gamma_get, > .fb_probe = bochsfb_create, > diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c > b/drivers/gpu/drm/cirrus/cirrus_fbdev.c > index 32bbba0a787b..2bd0291168e4 100644 > --- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c > +++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c > @@ -288,7 +288,7 @@ static int cirrus_fbdev_destroy(struct drm_device *dev, > return 0; > } > > -static struct drm_fb_helper_funcs cirrus_fb_helper_funcs = { > +static const struct drm_fb_helper_funcs cirrus_fb_helper_funcs = { > .gamma_set = cirrus_crtc_fb_gamma_set, > .gamma_get = cirrus_crtc_fb_gamma_get, > .fb_probe = cirrusfb_create, > diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c > b/drivers/gpu/drm/drm_fb_cma_helper.c > index 61b5a47ad239..b74f9e58b69d 100644 > --- a/drivers/gpu/drm/drm_fb_cma_helper.c > +++ b/drivers/gpu/drm/drm_fb_cma_helper.c > @@ -327,7 +327,7 @@ err_drm_gem_cma_free_object: > return ret; > } > > -static struct drm_fb_helper_funcs drm_fb_cma_helper_funcs = { > +static const struct drm_fb_helper_funcs drm_fb_cma_helper_funcs = { > .fb_probe = drm_fbdev_cma_create, > }; > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c > b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c > index addbf7536da4..7ccf04917f47 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c > @@ -233,7 +233,7 @@ out: > return ret; > } > > -static struct drm_fb_helper_funcs exynos_drm_fb_helper_funcs = { > +static const struct drm_fb_helper_funcs exynos_drm_fb_helper_funcs = { > .fb_probe = exynos_drm_fbdev_create, > }; > > diff --git a/drivers/gpu/drm/gma500/framebuffer.c > b/drivers/gpu/drm/gma500/framebuffer.c > index e7fcc148f333..76e4d777d01d 100644 > --- a/drivers/gpu/drm/gma500/framebuffer.c > +++ b/drivers/gpu/drm/gma500/framebuffer.c > @@ -561,7 +561,7 @@ static int psbfb_probe(struct drm_fb_helper *helper, > return psbfb_create(psb_fbdev, sizes); > } > > -static struct drm_fb_helper_fu