diff options
| author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2024-08-27 21:57:58 +0200 |
|---|---|---|
| committer | Hans Verkuil <hverkuil@xs4all.nl> | 2025-02-21 10:33:15 +0100 |
| commit | 70d4fd1200ca6cdd670c51ec3f1895b5a262261c (patch) | |
| tree | c51ceb9c86c9045ac16f097fd21c1603bb82a17a /include/media | |
| parent | d22d91fb1d7f04130d6b5371315fdaeddd6a2fc6 (diff) | |
| download | linux-70d4fd1200ca6cdd670c51ec3f1895b5a262261c.tar.gz linux-70d4fd1200ca6cdd670c51ec3f1895b5a262261c.tar.bz2 linux-70d4fd1200ca6cdd670c51ec3f1895b5a262261c.zip | |
media: tuners: Constify struct tunertype, tuner_range and tuner_params
'struct tunertype', 'struct tuner_range' and 'struct tuner_params' are not
modified in this driver.
Constifying these structures moves some data to a read-only section, so
increase overall security.
On a x86_64, with allmodconfig:
Before:
======
2877 8554 0 11431 2ca7 drivers/media/tuners/tuner-types.o
After:
=====
text data bss dec hex filename
11421 48 0 11469 2ccd drivers/media/tuners/tuner-types.o
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'include/media')
| -rw-r--r-- | include/media/tuner-types.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h index df76ac8e658c..c79b773f750c 100644 --- a/include/media/tuner-types.h +++ b/include/media/tuner-types.h @@ -168,7 +168,7 @@ struct tuner_params { u16 iffreq; unsigned int count; - struct tuner_range *ranges; + const struct tuner_range *ranges; }; /** @@ -189,7 +189,7 @@ struct tuner_params { struct tunertype { char *name; unsigned int count; - struct tuner_params *params; + const struct tuner_params *params; u16 min; u16 max; @@ -199,7 +199,7 @@ struct tunertype { u8 *sleepdata; }; -extern struct tunertype tuners[]; +extern const struct tunertype tuners[]; extern unsigned const int tuner_count; #endif |
