From patchwork Wed Nov 4 04:07:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jassi Brar X-Patchwork-Id: 55961 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp2195921lbr; Tue, 3 Nov 2015 20:07:38 -0800 (PST) X-Received: by 10.68.114.66 with SMTP id je2mr23829627pbb.50.1446610058533; Tue, 03 Nov 2015 20:07:38 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vw1si47357761pbc.120.2015.11.03.20.07.37; Tue, 03 Nov 2015 20: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; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755026AbbKDEHg (ORCPT + 28 others); Tue, 3 Nov 2015 23:07:36 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:33263 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754777AbbKDEHe (ORCPT ); Tue, 3 Nov 2015 23:07:34 -0500 Received: by pabfh17 with SMTP id fh17so39397042pab.0 for ; Tue, 03 Nov 2015 20:07:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=kSdeb8ugjd7pQzppHV+Mkdn4MqueDGUcVdEyLoFbhzE=; b=RfbFsV8yOuKcued6AuY29TaL66pm81isXoCAbu1HbeEyD6+ilGbPGTBLCc7QcFk+/H J+n+IPljKTYnlqoPxwwjLrVY6Bf9ng2Ke9vMACi35DaxTwIvGFhkjKRXBHDpHcDuPTqB f7Fc91Hem7K1bpnmu3vACDI3k8eaNewAIiYyRn1iimgpnFZPm7+vLTQoxTYdtwvSkFNg Y37D9ne6sFJrgK6A9xtW3zpdh4tZEPMcue0m7j1Dm8pOoO6NhDESoCEreG7dCRzoN2BA bSLVM8E+xMVpxPLOlU4fqXtagp/iGT5XGnI1jGhGbFlqZUHsqW3rHTcd11D5AUeR7y7w G0sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kSdeb8ugjd7pQzppHV+Mkdn4MqueDGUcVdEyLoFbhzE=; b=XpN1yfQuvRxE7S4cI/gebZqEnrCuxvHTnMyKpkL1i+4aG9lgGJKpxPSWdE0t0kd8Ln Wb+yjwFNYI8bZlb2UsPFTTTcr1WD9ScsCYVUOuAChT8siqevsGPYNHV9YM6i7yr+3E7i 4nMeeRg7eDibC8WjUKn607V47668C4/jqRhyUAyBGsPRCejf4UD4kyJTwKmbVaY/DU6Y mOsS+Uiai9+38znDT/5o28debIPKIZzvF07L+ow7xbBdlbNNzDycS2zt3A8sFm0OQ+dn TnvwJQ9bKeuGkorWA/59bcUPrB/vBKpSMCAEnvlLAzNKQd2HVKmk6bEFkNvoETzq4inJ K5lA== X-Gm-Message-State: ALoCoQmh+TXJ83vzwvAa/oztBGXedNI5PnS+x3BGhh9L5F6XEFeybTyX9zlbIw60J7CflgSNL3yr X-Received: by 10.68.103.194 with SMTP id fy2mr38533106pbb.31.1446610054362; Tue, 03 Nov 2015 20:07:34 -0800 (PST) Received: from localhost.localdomain ([61.1.158.146]) by smtp.gmail.com with ESMTPSA id ju7sm32284215pbc.46.2015.11.03.20.07.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Nov 2015 20:07:33 -0800 (PST) From: jaswinder.singh@linaro.org X-Google-Original-From: jassisinghbrar@gmail.com To: linux-kernel@vger.kernel.org Cc: lee.jones@linaro.org, sfr@canb.auug.org.au, Jassi Brar Subject: [PATCH] mailbox: mailbox-test: avoid reading iomem twice Date: Wed, 4 Nov 2015 09:37:06 +0530 Message-Id: <1446610026-14959-1-git-send-email-jassisinghbrar@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jassi Brar Don't pass mmio region as source to print_hex_dump() and then again to memcpy_fromio(). Do it once and give print_hex_dump() the buffer we just read the data in. Signed-off-by: Jassi Brar --- drivers/mailbox/mailbox-test.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ Acked-by: Lee Jones diff --git a/drivers/mailbox/mailbox-test.c b/drivers/mailbox/mailbox-test.c index f82dc89..684ae17 100644 --- a/drivers/mailbox/mailbox-test.c +++ b/drivers/mailbox/mailbox-test.c @@ -221,11 +221,10 @@ static void mbox_test_receive_message(struct mbox_client *client, void *message) spin_lock_irqsave(&tdev->lock, flags); if (tdev->mmio) { + memcpy_fromio(tdev->rx_buffer, tdev->mmio, MBOX_MAX_MSG_LEN); print_hex_dump(KERN_INFO, "Client: Received [MMIO]: ", DUMP_PREFIX_ADDRESS, MBOX_BYTES_PER_LINE, 1, - __io_virt(tdev->mmio), MBOX_MAX_MSG_LEN, true); - memcpy_fromio(tdev->rx_buffer, tdev->mmio, MBOX_MAX_MSG_LEN); - + tdev->rx_buffer, MBOX_MAX_MSG_LEN, true); } else if (message) { print_hex_dump(KERN_INFO, "Client: Received [API]: ", DUMP_PREFIX_ADDRESS, MBOX_BYTES_PER_LINE, 1,