diff options
author | Oscar Carter <oscar.carter@gmx.com> | 2020-04-25 18:17:45 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-28 15:26:29 +0300 |
commit | 8a5baa66b01f6bfbb4f2456fdd4a8fe3896d7119 (patch) | |
tree | c42b27a742b6fa1f9fbb8ccd147714c49ea611b1 /drivers/staging/vt6656 | |
parent | 5fa83c2566660956e6556e1090e24c642eb93822 (diff) | |
download | linux-8a5baa66b01f6bfbb4f2456fdd4a8fe3896d7119.tar.xz |
staging: vt6656: Remove the local variable "array"
Remove the local variable "array" and all the memcpy function calls
because this copy operation from different arrays to this variable is
unnecessary.
The vnt_control_out function already does a kmemdup copy of its const
char *buffer argument and this was made unnecessary by:
commit 12ecd24ef932
("staging: vt6656: use off stack for out buffer USB transfers.")
Author: Malcolm Priestley <tvboxspy@gmail.com>
Date: Sat Apr 22 11:14:57 2017 +0100
staging: vt6656: use off stack for out buffer USB transfers.
Since 4.9 mandated USB buffers be heap allocated this causes the driver
to fail.
Since there is a wide range of buffer sizes use kmemdup to create
allocated buffer.
So, the same result can be achieved using the arrays directly.
Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200425151747.8199-2-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656')
-rw-r--r-- | drivers/staging/vt6656/rf.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c index 05c9d06f84dd..12a3f47076fb 100644 --- a/drivers/staging/vt6656/rf.c +++ b/drivers/staging/vt6656/rf.c @@ -763,7 +763,6 @@ int vnt_rf_table_download(struct vnt_private *priv) u16 length1 = 0, length2 = 0, length3 = 0; u8 *addr1 = NULL, *addr2 = NULL, *addr3 = NULL; u16 length, value; - u8 array[256]; switch (priv->rf_type) { case RF_AL2230: @@ -810,10 +809,8 @@ int vnt_rf_table_download(struct vnt_private *priv) } /* Init Table */ - memcpy(array, addr1, length1); - ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0, - MESSAGE_REQUEST_RF_INIT, length1, array); + MESSAGE_REQUEST_RF_INIT, length1, addr1); if (ret) goto end; @@ -825,10 +822,8 @@ int vnt_rf_table_download(struct vnt_private *priv) else length = length2; - memcpy(array, addr2, length); - ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE, value, - MESSAGE_REQUEST_RF_CH0, length, array); + MESSAGE_REQUEST_RF_CH0, length, addr2); if (ret) goto end; @@ -845,10 +840,8 @@ int vnt_rf_table_download(struct vnt_private *priv) else length = length3; - memcpy(array, addr3, length); - ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE, value, - MESSAGE_REQUEST_RF_CH1, length, array); + MESSAGE_REQUEST_RF_CH1, length, addr3); if (ret) goto end; @@ -863,11 +856,9 @@ int vnt_rf_table_download(struct vnt_private *priv) addr1 = &al7230_init_table_amode[0][0]; addr2 = &al7230_channel_table2[0][0]; - memcpy(array, addr1, length1); - /* Init Table 2 */ ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0, - MESSAGE_REQUEST_RF_INIT2, length1, array); + MESSAGE_REQUEST_RF_INIT2, length1, addr1); if (ret) goto end; @@ -879,11 +870,9 @@ int vnt_rf_table_download(struct vnt_private *priv) else length = length2; - memcpy(array, addr2, length); - ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE, value, MESSAGE_REQUEST_RF_CH2, length, - array); + addr2); if (ret) goto end; |