diff options
author | Oscar Carter <oscar.carter@gmx.com> | 2020-05-04 19:14:14 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-05 12:33:00 +0200 |
commit | 2e11cc1ab790ccbc7c7f6ed74c0f40b85c561dc7 (patch) | |
tree | b0bfcb0808bdd55c138b9027bfce8d52220a1153 /tools/testing/selftests/ftrace/test.d/functions | |
parent | 0729bb9b2a97a279c4b7c7be8565d494aab3d6e9 (diff) |
staging: vt6656: Use const for read only data
Use const for the arrays that are used as "read only". Also, modify the
prototype of vnt_control_out_blocks() function to use a pointer to a
const type.
The vnt_vt3184_al2230 array can't be converted to const as it's modified
later.
Then in the vnt_vt3184_init() function use two types of pointers (to
const type and to no const type) to avoid the compiler warning:
assignment discards 'const' qualifiers from pointer target type
This way decrease the .data section and increase the .rodata section
limiting the surface attack.
Before this change:
-------------------
drivers/staging/vt6656/baseband.o :
section size addr
.text 1278 0
.data 576 0
.bss 0 0
.rodata 319 0
.comment 45 0
.note.GNU-stack 0 0
.note.gnu.property 32 0
Total 2250
After this change:
------------------
drivers/staging/vt6656/baseband.o :
section size addr
.text 1278 0
.data 256 0
.bss 0 0
.rodata 640 0
.comment 45 0
.note.GNU-stack 0 0
.note.gnu.property 32 0
Total 2251
Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200504171414.11307-1-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/ftrace/test.d/functions')
0 files changed, 0 insertions, 0 deletions