Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2354304imj; Mon, 11 Feb 2019 01:07:38 -0800 (PST) X-Google-Smtp-Source: AHgI3IYeky3qvX/woBnO8ODzyLGZKtIUnQMine3J03ZG+2+VpakNhRwxNSkUE/m852tRNwCt7Bqy X-Received: by 2002:a63:dc53:: with SMTP id f19mr24353165pgj.406.1549876058418; Mon, 11 Feb 2019 01:07:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549876058; cv=none; d=google.com; s=arc-20160816; b=nAhICLWNYefvyrfDC7A6UPyta5BjGa66OnEK4O0BZLJvmxPOz//TJ5KnzmvhNU8y8t 1V5nP3+DnI4tIAG08T3cfPw2Y9DlgPd2WeD3Psb6cM15V99ZefU9ZAoNHsiLGkSq5os3 GqZgfaAF8AdAQrQQ6n9bBlvmz4ETH7duC7UeejxjXazo6D3vPnWzn8n+llBQTb3g9Cj6 HKZSaLpEEf+bwuWK52m1bPyrD+A8w4S8nqD4UoFT++Vg9ZHNsMlWSTw5S+sQodPmh/rt lB96EvUNARKzdXOap6QBkqlRkY+hslPwEuSrY+VUlIWMlLc28S9nx+KBxYtSYPhTqWHr y4zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=10/r8K96SuW84M2YCenchk6ETyBSg7qVJ2+bp5eGI74=; b=qy2uy3z4mVc+jY/u+mpSzUqoNaEo5mmnghzrv99AUL1mTXEJU0/Zs8HHvC3kUJo4+1 9tSJeMtat2AF+8/EASzczu4tB2/UIPVpmWXseNfCebB8IL/Kwgax1+e/fr3PYhQJTQ5J e7Z9mx42l2jLtoxi/2UH+dkJWgfWCYhb7mwDI34Fmf41fAIUrXVzgykWtybzSC2fTtko 8rjIdNPwq+Qd82pn+dFMq35QhyrOlxs86SWmbQm+kqf5aepSs6f2i+NdnShtLjvwOFKe U2ZdtlmU7/uccpZYAYg78mR0vmcow47f+XgWvqRCh/m6dyX6t/r1aQ2JKkRdup33wTzc wSow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si8796893pgc.365.2019.02.11.01.07.22; Mon, 11 Feb 2019 01:07:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726891AbfBKJFo (ORCPT + 99 others); Mon, 11 Feb 2019 04:05:44 -0500 Received: from mxhk.zte.com.cn ([63.217.80.70]:14064 "EHLO mxhk.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725986AbfBKJFo (ORCPT ); Mon, 11 Feb 2019 04:05:44 -0500 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 8CEE6B6F17CF714DC1AC; Mon, 11 Feb 2019 17:05:39 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x1B94sfg091155; Mon, 11 Feb 2019 17:04:54 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019021117050126-25612634 ; Mon, 11 Feb 2019 17:05:01 +0800 From: Wen Yang To: kishon@ti.com Cc: lorenzo.pieralisi@arm.com, bhelgaas@google.com, gustavo.pimentel@synopsys.com, niklas.cassel@axis.com, baijiaju1990@gmail.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, xue.zhihong@zte.com.cn, wang.yi59@zte.com.cn, Wen Yang , Greg Kroah-Hartman , Cyrille Pitchen Subject: [PATCH] PCI: endpoint: functions: use memcpy_fromio()/memcpy_toio() Date: Mon, 11 Feb 2019 17:04:00 +0800 Message-Id: <1549875840-10582-1-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-02-11 17:05:01, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-02-11 17:04:54, Serialize complete at 2019-02-11 17:04:54 X-MAIL: mse01.zte.com.cn x1B94sfg091155 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the IO memcpy() functions when copying from/to IO memory. These locations were found via sparse. Signed-off-by: Wen Yang Suggested-by: Kishon Vijay Abraham I CC: Lorenzo Pieralisi CC: Bjorn Helgaas CC: Gustavo Pimentel CC: Niklas Cassel CC: Greg Kroah-Hartman CC: Cyrille Pitchen CC: linux-pci@vger.kernel.org CC: linux-kernel@vger.kernel.org --- drivers/pci/endpoint/functions/pci-epf-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c index 3e86fa3..4bbd26e 100644 --- a/drivers/pci/endpoint/functions/pci-epf-test.c +++ b/drivers/pci/endpoint/functions/pci-epf-test.c @@ -175,7 +175,7 @@ static int pci_epf_test_read(struct pci_epf_test *epf_test) goto err_map_addr; } - memcpy(buf, src_addr, reg->size); + memcpy_fromio(buf, src_addr, reg->size); crc32 = crc32_le(~0, buf, reg->size); if (crc32 != reg->checksum) @@ -230,7 +230,7 @@ static int pci_epf_test_write(struct pci_epf_test *epf_test) get_random_bytes(buf, reg->size); reg->checksum = crc32_le(~0, buf, reg->size); - memcpy(dst_addr, buf, reg->size); + memcpy_toio(dst_addr, buf, reg->size); /* * wait 1ms inorder for the write to complete. Without this delay L3 -- 2.9.5