Message ID | 7c4a1ca4525a1d1429c9f16ccfc6d8bf80fc2b63.1720942618.git.christophe.jaillet@wanadoo.fr (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/exynos: Constify struct exynos_drm_ipp_funcs | expand |
Hi Christophe JAILLET, 2024년 7월 14일 (일) 오후 4:37, Christophe JAILLET <christophe.jaillet@wanadoo.fr>님이 작성: > > 'struct exynos_drm_ipp_funcs' are not modified in these drivers. > > Constifying this structure moves some data to a read-only section, so > increase overall security. > > On a x86_64, with allmodconfig, as an example: > Before: > ====== > text data bss dec hex filename > 20446 1746 16 22208 56c0 drivers/gpu/drm/exynos/exynos_drm_fimc.o > > After: > ===== > text data bss dec hex filename > 20446 1714 16 22176 56a0 drivers/gpu/drm/exynos/exynos_drm_fimc.o > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Applied. Thank for contribution, Inki Dae > --- > Compile tested-only. > --- > drivers/gpu/drm/exynos/exynos_drm_fimc.c | 2 +- > drivers/gpu/drm/exynos/exynos_drm_gsc.c | 2 +- > drivers/gpu/drm/exynos/exynos_drm_scaler.c | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c > index 142184c8c3bc..4d7ea65b7dd8 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c > @@ -1125,7 +1125,7 @@ static void fimc_abort(struct exynos_drm_ipp *ipp, > } > } > > -static struct exynos_drm_ipp_funcs ipp_funcs = { > +static const struct exynos_drm_ipp_funcs ipp_funcs = { > .commit = fimc_commit, > .abort = fimc_abort, > }; > diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c > index 1b111e2c3347..d80b0d1eb734 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c > @@ -1162,7 +1162,7 @@ static void gsc_abort(struct exynos_drm_ipp *ipp, > } > } > > -static struct exynos_drm_ipp_funcs ipp_funcs = { > +static const struct exynos_drm_ipp_funcs ipp_funcs = { > .commit = gsc_commit, > .abort = gsc_abort, > }; > diff --git a/drivers/gpu/drm/exynos/exynos_drm_scaler.c b/drivers/gpu/drm/exynos/exynos_drm_scaler.c > index a9d469896824..2788105ac780 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_scaler.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_scaler.c > @@ -403,7 +403,7 @@ static int scaler_commit(struct exynos_drm_ipp *ipp, > return 0; > } > > -static struct exynos_drm_ipp_funcs ipp_funcs = { > +static const struct exynos_drm_ipp_funcs ipp_funcs = { > .commit = scaler_commit, > }; > > -- > 2.45.2 > >
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 142184c8c3bc..4d7ea65b7dd8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1125,7 +1125,7 @@ static void fimc_abort(struct exynos_drm_ipp *ipp, } } -static struct exynos_drm_ipp_funcs ipp_funcs = { +static const struct exynos_drm_ipp_funcs ipp_funcs = { .commit = fimc_commit, .abort = fimc_abort, }; diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 1b111e2c3347..d80b0d1eb734 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1162,7 +1162,7 @@ static void gsc_abort(struct exynos_drm_ipp *ipp, } } -static struct exynos_drm_ipp_funcs ipp_funcs = { +static const struct exynos_drm_ipp_funcs ipp_funcs = { .commit = gsc_commit, .abort = gsc_abort, }; diff --git a/drivers/gpu/drm/exynos/exynos_drm_scaler.c b/drivers/gpu/drm/exynos/exynos_drm_scaler.c index a9d469896824..2788105ac780 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_scaler.c +++ b/drivers/gpu/drm/exynos/exynos_drm_scaler.c @@ -403,7 +403,7 @@ static int scaler_commit(struct exynos_drm_ipp *ipp, return 0; } -static struct exynos_drm_ipp_funcs ipp_funcs = { +static const struct exynos_drm_ipp_funcs ipp_funcs = { .commit = scaler_commit, };
'struct exynos_drm_ipp_funcs' are not modified in these drivers. Constifying this structure moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig, as an example: Before: ====== text data bss dec hex filename 20446 1746 16 22208 56c0 drivers/gpu/drm/exynos/exynos_drm_fimc.o After: ===== text data bss dec hex filename 20446 1714 16 22176 56a0 drivers/gpu/drm/exynos/exynos_drm_fimc.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> --- Compile tested-only. --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_scaler.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)