Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp848360ybz; Sat, 25 Apr 2020 05:41:35 -0700 (PDT) X-Google-Smtp-Source: APiQypLo5wIq0stNe8XkFhry1wy3oZi8fz3rsgpDn1N/X8cbxTMDV0UDLBMHcEhaDvPy2fX6RMT8 X-Received: by 2002:a50:fc0d:: with SMTP id i13mr10768118edr.280.1587818495312; Sat, 25 Apr 2020 05:41:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587818495; cv=none; d=google.com; s=arc-20160816; b=IxEBXHstVOWgo/wPDXCFSCOFQz2Ik3Q2yUP3i47DX4jaz88nTjndUGL5sRtNpektRU lsq/8bbJLytXOZAaXUcGDtGMY2G020Lz90yaFWU9yGirFs8voCeEtpwt1V2aHyylTdiY KPNPsfXJAH9IRovy/qf4mF8EAI7t695VwLKh7cns1Vf9HihQzJEVbfFohqqEhMC5yaCA qGAcbNwvcNE+7kFGE8ThTGUXOFzmtXKjcwFB/tH7tKjU4hzjCiXsUHrIROYtGMOT+7qF yUfni6hHeO1s8TRDxvAx8ATCtfZU1+xVY/xIIF4DpW83mnzg2MWVi0WjrlYGVngzyYqk wkyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Zsw4b1E78ZOPM5RcHuJyTBCV3h8Lgc0mRNMYXdgRSCA=; b=VdP/+T6hdThs2nHvJbKxgIZb5czUtRCsWuW9QlJEgodwY68XXA0/TEic4EignhQzdW wkC4v+VUy3GmWCYeAwhJqmn9oqttXwOSdDI3modhBBJIJVbun01S8ZaYQqmSshW3J5op 6f531EWhC4p1D868ODItHWJM2VwKPr3bchLf3Y24IiR5oxZ2W6MGjcoEuzERCtC7sgc4 6Oa+u6Ojc7hHt6BK/sJM0sgzlhqVN/VA4pSKFI3rrBglDADoDd52f46mQYTRC0YNDfxO Z+0ir5CTPHADHHhADk094J1itysqqq4F/NI3rTjZWXn5Y/4LuG55cMzxiO1TewyvPHjT gA7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=fOQfXH9Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cd11si4794596ejb.435.2020.04.25.05.41.12; Sat, 25 Apr 2020 05:41:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=fOQfXH9Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726125AbgDYMjv (ORCPT + 99 others); Sat, 25 Apr 2020 08:39:51 -0400 Received: from mout.gmx.net ([212.227.15.15]:53477 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725925AbgDYMju (ORCPT ); Sat, 25 Apr 2020 08:39:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1587818382; bh=5SG9BzflKv7Fzm0xhOrgRj/a0QfgGzvqTTTXIn76vpo=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=fOQfXH9Q94acOyDU/TPyocNRBEW1AfVm+OHknxQNtjWoRKBhWwWNXEfn46tDlnjpB dJF1nnFRY91xg0VXrWWHBuecllyQCISmMxvOy4oJO77hq+Fn1uDpgxvfDwUoXB6FQ6 RqdKtf4bfn1Ja5KrJBit7dhypIE/F2LDXoxrAPQA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([83.52.229.196]) by mail.gmx.com (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1N7i8O-1j73rY1VQo-014jNt; Sat, 25 Apr 2020 14:39:42 +0200 From: Oscar Carter To: Forest Bond , Greg Kroah-Hartman Cc: Oscar Carter , Malcolm Priestley , Quentin Deslandes , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] staging: vt6656: Remove the local variable "array" Date: Sat, 25 Apr 2020 14:38:42 +0200 Message-Id: <20200425123844.7959-2-oscar.carter@gmx.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200425123844.7959-1-oscar.carter@gmx.com> References: <20200425123844.7959-1-oscar.carter@gmx.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ikptTVomcIa2Ak7P7aCNKI7F/Z4TRsm7UP1vbjo5KQhjN5KFMp6 0kORStaVnog4RmjXsa3eWaiEex0BmLVuKpWsH/xlL5lQfoDYvBCumG+5ymj1JDYvevzcuSn h/ONhh6m7iC37TO4ujHhggau0OTKzwfJcsXlrE4hQTVSdHj0W6k5GjUA/K9JOZExy2vy7ff fTc6/GgGkybLw2YrvcUcw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:xQYBUl6RL+s=:7xj96gcFiAkfTrHzVSKQlm fB4z9umJFgAs5BEvq6+0sy/OYuPlwz6czjpToK9TbwpGMUZc+jJsgAdZd1yuTA+ZsbKJMj+u1 wgF03r1m5HFOXXOY77+k99+K4eke+MRKrq/EANUFX2v3VbgM4Cjt+TT++rY8ci5cW2ZPvSJG8 pW1krlUSbAgQfYRRvQ1rGokzV0MYeVSUBr7YuFwCs9UXgwrN34LDwVoyKu5CG5Q50roJs5DXd R9L2tJoexDoVrjU/YLfGChI0XciUwgC+A7lkjALIYkuzvYuIaJvEJsOzg6jVop0t78dnxH0MN 4Fv51ACWzKGgK5nI0JqTSj24PgyasuZxBZYbEH/K/r6dtvH5CMt162y5YfU9+gZwh8PSXz+A3 y51/QS5AGjDCeBUgZ4KJ1AagJ7b+LRxUvjgN1LpH7UqaxJltv232XqQ5fuGgi2n58uGzRR/kr Rq5sPKeDaxWUnkfUPtSC47gC0smaasgJqp9RiEKEuc/bq6nDqeIbZMXguGKzNApLEorAQoxFm 9+ZR3AZD+DCwYAhgWRHoFUN6Ol+QaUavULNsJN0qxncf5x8T/Fq++7v68YbkurvffVmXXcqZt azgyfXGcL1p7ayXlGI2XXapLLy5J+UK0TcLqD2OgFpQEpykvEkCcGMBw1X1fv4Jsru50SImfQ wMM613aEqeTnHNNNOwUwCov7c5//JOJmaOSUbnHCodLVY/BooK5mMGfeuBGayS5hiNSgkZNIK 01EOsTuVFODYJY1v9SoBRtz44+QFwNYXJCcFHrerSJfabC1Pf0zprOhMwTu0GqkLQSJxpeLnJ cAcgW8pGKCqSssN8zu7dT3FaG4ZJQduEOEuEmpxzhOuW3q64fTXQoM2/O45AIfSQgkt61MZs6 mhcT6oqFzPhrSN2RUSQ7kQvMRlF2fXhRfRSas1Rur2DiRziMIQgqAYSdNmVPdAGl0/M8q+dFx j0Xn8G8ke31rUjdcZrG71cycXvPnhgkQbUmbL263M88OQG+ZLub/ekAGHykZwdyf27YRX2nqo 3QFB46nVKhE1IlOQY9P0KKhgg1pIf2HKzXBtW7zjolWFfXJWtyZbbEn4DS8Qp9caudebnobTy uAuLkPoTW7Lr0dQGJqh55Fzo+J3rZjeUyKEpzEjyWmzsGfNispds70MKg+tbpDjVhPecPtzFz uqjbpoz+D/EghR77NCMaB5ieNIwve65WVFAQAm3Sf06UeBmjq/uvdju1eZrcIW09/b1RkX9kr tC7wijsRdXHBm2qEp Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove the local variable "array" and all the memcpy function calls because this copy operation from different arrays to this variable is unnecessary. The same result can be achieved using the arrays directly. Signed-off-by: Oscar Carter =2D-- drivers/staging/vt6656/rf.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c index 06fa8867cfa3..82d3b6081b5b 100644 =2D-- a/drivers/staging/vt6656/rf.c +++ b/drivers/staging/vt6656/rf.c @@ -770,7 +770,6 @@ int vnt_rf_table_download(struct vnt_private *priv) u16 length1 =3D 0, length2 =3D 0, length3 =3D 0; u8 *addr1 =3D NULL, *addr2 =3D NULL, *addr3 =3D NULL; u16 length, value; - u8 array[256]; switch (priv->rf_type) { case RF_AL2230: @@ -817,10 +816,8 @@ int vnt_rf_table_download(struct vnt_private *priv) } /* Init Table */ - memcpy(array, addr1, length1); - ret =3D vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0, - MESSAGE_REQUEST_RF_INIT, length1, array); + MESSAGE_REQUEST_RF_INIT, length1, addr1); if (ret) goto end; @@ -832,10 +829,8 @@ int vnt_rf_table_download(struct vnt_private *priv) else length =3D length2; - memcpy(array, addr2, length); - ret =3D vnt_control_out(priv, MESSAGE_TYPE_WRITE, value, - MESSAGE_REQUEST_RF_CH0, length, array); + MESSAGE_REQUEST_RF_CH0, length, addr2); if (ret) goto end; @@ -852,10 +847,8 @@ int vnt_rf_table_download(struct vnt_private *priv) else length =3D length3; - memcpy(array, addr3, length); - ret =3D vnt_control_out(priv, MESSAGE_TYPE_WRITE, value, - MESSAGE_REQUEST_RF_CH1, length, array); + MESSAGE_REQUEST_RF_CH1, length, addr3); if (ret) goto end; @@ -870,11 +863,9 @@ int vnt_rf_table_download(struct vnt_private *priv) addr1 =3D &al7230_init_table_amode[0][0]; addr2 =3D &al7230_channel_table2[0][0]; - memcpy(array, addr1, length1); - /* Init Table 2 */ ret =3D vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0, - MESSAGE_REQUEST_RF_INIT2, length1, array); + MESSAGE_REQUEST_RF_INIT2, length1, addr1); if (ret) goto end; @@ -886,11 +877,9 @@ int vnt_rf_table_download(struct vnt_private *priv) else length =3D length2; - memcpy(array, addr2, length); - ret =3D vnt_control_out(priv, MESSAGE_TYPE_WRITE, value, MESSAGE_REQUEST_RF_CH2, length, - array); + addr2); if (ret) goto end; =2D- 2.20.1