From patchwork Sat Feb 29 20:33:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 11413993 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 02FA6930 for ; Sat, 29 Feb 2020 20:34:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C7D9A20684 for ; Sat, 29 Feb 2020 20:33:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JbBDTY++" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727470AbgB2Ud7 (ORCPT ); Sat, 29 Feb 2020 15:33:59 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:42510 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727412AbgB2Ud6 (ORCPT ); Sat, 29 Feb 2020 15:33:58 -0500 Received: by mail-wr1-f66.google.com with SMTP id p18so7579478wre.9 for ; Sat, 29 Feb 2020 12:33:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=Zt3dq1OUkMEUcUXW65qyxooApGG+qBeaodqKhZlMmPE=; b=JbBDTY++uSsVrcYM05asL6cIXEST1QQi6vSxyskSsjGDkrsnZGvIJcvG/XPIPBnqKp PFrt7L1A0B0Hy99+rv8yAw8SEE5sPCtfVHnHb4pj7Nnlwxu6AoaDbNrozSJ61KZOmvNd JFi3S1nTzfTvXGmssIJVRK0MySvv3RtvGCxdAIgBK7taVUakmntRsp2oHat26dfDy43l 7TRmgM9WFxH0wjV8XJKA+74DEEIllSN8Gvb3IGoJz9EZ6TMgbOC0l+sTZnW0YORtqGAo uTYo9o0OLtSw6SFzznqxP20u6VmHOOAriwO9hP+gdKQqma65k7Lw4sB6DU4lNOLvw3ax 2hcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=Zt3dq1OUkMEUcUXW65qyxooApGG+qBeaodqKhZlMmPE=; b=syYt91BAYCOAnazfWm9WIuki/dR1mM3GFDirmbrqPFYQPhb+ZcBpJzw1D+REeLhvtZ eM0B8/TH6ySWYcQdrO57TQbKEkhXio5i3GMjkdFkuUVdmphjwQVTbpHrA0X19kRuBt8W P6VcIn4a19w0DEKfkWVAwnL4+UW6+sd40u2ePaRMS7B+mC70a6rwFeUYNLBw2CHhVnYF 5YV6oiGLeQcprq2HlL1f+sxoZfemaCS3B816kCho5AnuKD6gVxeyfysK0aGGSfMPCDms Rjel/e7vZ94Jtz42cWNy9UCpaitff9y+6TtDj7LPwQU/1itgX+CIugD/1VaawFVznAna iMKQ== X-Gm-Message-State: APjAAAVxOueoL+w0GYctz3Tcaa+6HL6PmdDURcCeqx+hKtgeZ1siBcfv xnaImt+eHzK0G1Tf1RJoR/esNaSX X-Google-Smtp-Source: APXvYqxzp+Dj+OvCiZn/aP2YmRrI+t1wRiYoB6g1TCn+nuk3NEGo5KZXit5wv97r9XkPXnV3L3VIMw== X-Received: by 2002:adf:9282:: with SMTP id 2mr12657562wrn.124.1583008436742; Sat, 29 Feb 2020 12:33:56 -0800 (PST) Received: from [192.168.43.18] (94.197.121.166.threembb.co.uk. [94.197.121.166]) by smtp.gmail.com with ESMTPSA id a9sm19644051wrn.3.2020.02.29.12.33.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 29 Feb 2020 12:33:56 -0800 (PST) To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org From: Malcolm Priestley Subject: [PATCH 1/2] staging: vt6656: use vnt_vt3184_agc array directly Message-ID: <4b455ee4-7ac7-e1ff-4a10-2d99f2e30714@gmail.com> Date: Sat, 29 Feb 2020 20:33:54 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- drivers/staging/vt6656/baseband.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c index f18e059ce66b..48a624bf00c0 100644 --- a/drivers/staging/vt6656/baseband.c +++ b/drivers/staging/vt6656/baseband.c @@ -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; From patchwork Sat Feb 29 20:37:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 11414031 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 876E41395 for ; Sat, 29 Feb 2020 20:37:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 625F820836 for ; Sat, 29 Feb 2020 20:37:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MO2KphJI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727470AbgB2Uhp (ORCPT ); Sat, 29 Feb 2020 15:37:45 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:45256 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727252AbgB2Uhp (ORCPT ); Sat, 29 Feb 2020 15:37:45 -0500 Received: by mail-wr1-f68.google.com with SMTP id v2so7545201wrp.12 for ; Sat, 29 Feb 2020 12:37:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=l56A/14PXkqGHLE8YMBNeU8cv7OpOINY7Us8P01pWEE=; b=MO2KphJIj8hI5R88Gmx0Gw2qjjdCiav9FlUhpY1aqLoMGZl1QkFTGZ3iz5gffN96oU bBGNA6Z79h5IeTF1VW5ZOru6p1u50ifOp1/ticiSPwxDx7nJC/OrlxnAR9RZlXcee85k u+Mz8/012JjFwXBcRPsxZ3sol82QY/iAZblG4KzlTTwil9ECebkMrs7WenJ9gOsENb1P j+ruhdDbP826ZJ9w/llk/VXDqW/gDWmiz7lcXDfh+3NfcEIgJ1fGWaVPB49LiI6vdWno FMKbVYUoHrbFz6qnZz9PZk23lnHVb4pSElMS/bfP/4g6H7URw+dWybdfIZzt+CNnLHo1 B3Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=l56A/14PXkqGHLE8YMBNeU8cv7OpOINY7Us8P01pWEE=; b=lwHMsAl5c4SPkM+GzCR+O2ZuOepXUuHiBUNKJAE0AgJY5YuJaBPzD9t1UiAeBi1CPQ n7puUljcNYavX15an9hvSwnwCRPmx5ZMQ2PBLImpjKbuK0oTFdp1esb6+IGmJqADNmhR DVS5VNvnIUAdF9vcmOe/U0YRQen64hmoxERN1VdlMZH0XigZCYIQdOJ9UH9SJz0XlNzB ReFma56WJ6LewTbZCWq4M734r7/rXmidqWcKDauqoW2ki4bnUAQSJwbbfZvX4qoidK02 XteR8Zsg0ZtC6UcEtli09Sh9HtF8JwHVkinEdfDkNLCcQdzZzU2+2ZCAW0L7gq3yaAKS ZxhA== X-Gm-Message-State: APjAAAXEVoM0ibVOCWZNrTgHKerLM+RhbnOxCyfC3/ez8rtGmWU1L5sZ ZfcbRwrYpkRRea94BRRm46wri3As X-Google-Smtp-Source: APXvYqyUwQEDtNilxtgNPnUsu8tsFDjgOhgZ1G3ZWAF+6VctctdlipuzAfGqQVaThsjBWldBYIyrGQ== X-Received: by 2002:adf:de09:: with SMTP id b9mr11826474wrm.160.1583008663505; Sat, 29 Feb 2020 12:37:43 -0800 (PST) Received: from [192.168.43.18] (94.197.121.166.threembb.co.uk. [94.197.121.166]) by smtp.gmail.com with ESMTPSA id b186sm7771432wmb.40.2020.02.29.12.37.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 29 Feb 2020 12:37:43 -0800 (PST) To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org From: Malcolm Priestley Subject: [PATCH 2/2] staging: vt6656: vnt_vt3184_init remove stack copy to array. Message-ID: <49f34764-c90c-8c5f-b4f2-a3668b13e519@gmail.com> Date: Sat, 29 Feb 2020 20:37:40 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org use u8 pointer addr directly and remove stack array. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/baseband.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c index 48a624bf00c0..74b620b4261e 100644 --- a/drivers/staging/vt6656/baseband.c +++ b/drivers/staging/vt6656/baseband.c @@ -367,7 +367,6 @@ int vnt_vt3184_init(struct vnt_private *priv) int ret = 0; u16 length; u8 *addr; - u8 array[256]; u8 data; ret = vnt_control_in(priv, MESSAGE_TYPE_READ, 0, MESSAGE_REQUEST_EEPROM, @@ -437,10 +436,8 @@ int vnt_vt3184_init(struct vnt_private *priv) goto end; } - memcpy(array, addr, length); - ret = vnt_control_out_blocks(priv, VNT_REG_BLOCK_SIZE, - MESSAGE_REQUEST_BBREG, length, array); + MESSAGE_REQUEST_BBREG, length, addr); if (ret) goto end;