staging: vt6656: use vnt_vt3184_agc array directly
authorMalcolm Priestley <tvboxspy@gmail.com>
Sat, 29 Feb 2020 20:33:54 +0000 (20:33 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Mar 2020 06:52:32 +0000 (07:52 +0100)
vnt_vt3184_agc is always the same regardless of rf type
so use the array directly removing from stack buffer.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/4b455ee4-7ac7-e1ff-4a10-2d99f2e30714@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/baseband.c

index f18e059..48a624b 100644 (file)
@@ -367,8 +367,6 @@ int vnt_vt3184_init(struct vnt_private *priv)
        int ret = 0;
        u16 length;
        u8 *addr;
-       u8 *agc;
-       u16 length_agc;
        u8 array[256];
        u8 data;
 
@@ -386,8 +384,6 @@ int vnt_vt3184_init(struct vnt_private *priv)
                priv->bb_rx_conf = vnt_vt3184_al2230[10];
                length = sizeof(vnt_vt3184_al2230);
                addr = vnt_vt3184_al2230;
-               agc = vnt_vt3184_agc;
-               length_agc = sizeof(vnt_vt3184_agc);
 
                priv->bb_vga[0] = 0x1C;
                priv->bb_vga[1] = 0x10;
@@ -398,8 +394,6 @@ int vnt_vt3184_init(struct vnt_private *priv)
                priv->bb_rx_conf = vnt_vt3184_al2230[10];
                length = sizeof(vnt_vt3184_al2230);
                addr = vnt_vt3184_al2230;
-               agc = vnt_vt3184_agc;
-               length_agc = sizeof(vnt_vt3184_agc);
 
                addr[0xd7] = 0x06;
 
@@ -413,8 +407,6 @@ int vnt_vt3184_init(struct vnt_private *priv)
                priv->bb_rx_conf = vnt_vt3184_vt3226d0[10];
                length = sizeof(vnt_vt3184_vt3226d0);
                addr = vnt_vt3184_vt3226d0;
-               agc = vnt_vt3184_agc;
-               length_agc = sizeof(vnt_vt3184_agc);
 
                priv->bb_vga[0] = 0x20;
                priv->bb_vga[1] = 0x10;
@@ -430,8 +422,6 @@ int vnt_vt3184_init(struct vnt_private *priv)
                priv->bb_rx_conf = vnt_vt3184_vt3226d0[10];
                length = sizeof(vnt_vt3184_vt3226d0);
                addr = vnt_vt3184_vt3226d0;
-               agc = vnt_vt3184_agc;
-               length_agc = sizeof(vnt_vt3184_agc);
 
                priv->bb_vga[0] = 0x20;
                priv->bb_vga[1] = 0x10;
@@ -454,10 +444,9 @@ int vnt_vt3184_init(struct vnt_private *priv)
        if (ret)
                goto end;
 
-       memcpy(array, agc, length_agc);
-
        ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0,
-                             MESSAGE_REQUEST_BBAGC, length_agc, array);
+                             MESSAGE_REQUEST_BBAGC,
+                             sizeof(vnt_vt3184_agc), vnt_vt3184_agc);
        if (ret)
                goto end;