Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: mediatek: vcodec: Constify struct vb2_ops

"struct vb2_ops" are not modified in this driver.

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

On a x86_64, with allmodconfig:
Before:
======
text data bss dec hex filename
18059 3096 16 21171 52b3 drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateful.o

After:
=====
text data bss dec hex filename
18171 2968 16 21155 52a3 drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateful.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

authored by

Christophe JAILLET and committed by
Hans Verkuil
41eb4fb5 7878d3a3

+2 -2
+1 -1
drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateful.c
··· 595 595 } 596 596 } 597 597 598 - static struct vb2_ops mtk_vdec_frame_vb2_ops = { 598 + static const struct vb2_ops mtk_vdec_frame_vb2_ops = { 599 599 .queue_setup = vb2ops_vdec_queue_setup, 600 600 .buf_prepare = vb2ops_vdec_buf_prepare, 601 601 .wait_prepare = vb2_ops_wait_prepare,
+1 -1
drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c
··· 854 854 return 0; 855 855 } 856 856 857 - static struct vb2_ops mtk_vdec_request_vb2_ops = { 857 + static const struct vb2_ops mtk_vdec_request_vb2_ops = { 858 858 .queue_setup = vb2ops_vdec_queue_setup, 859 859 .wait_prepare = vb2_ops_wait_prepare, 860 860 .wait_finish = vb2_ops_wait_finish,