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 /drivers/staging/vt6656/usbpipe.c | |
parent | 0729bb9b2a97a279c4b7c7be8565d494aab3d6e9 (diff) | |
download | linux-2e11cc1ab790ccbc7c7f6ed74c0f40b85c561dc7.tar.bz2 |
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 'drivers/staging/vt6656/usbpipe.c')
-rw-r--r-- | drivers/staging/vt6656/usbpipe.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c index 5603f3cbb33c..06dedf291db2 100644 --- a/drivers/staging/vt6656/usbpipe.c +++ b/drivers/staging/vt6656/usbpipe.c @@ -77,7 +77,7 @@ int vnt_control_out_u8(struct vnt_private *priv, u8 reg, u8 reg_off, u8 data) } int vnt_control_out_blocks(struct vnt_private *priv, - u16 block, u8 reg, u16 length, u8 *data) + u16 block, u8 reg, u16 length, const u8 *data) { int ret = 0, i; |