From: Arnd Bergmann <arnd@arndb.de>
To: Ohad Ben-Cohen <ohad@wizery.com>,
Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>,
Andy Gross <andy.gross@linaro.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] remoteproc: qcom: use %pap format string for phys_addr_t
Date: Mon, 6 Nov 2017 14:37:17 +0100 [thread overview]
Message-ID: <20171106133736.584646-1-arnd@arndb.de> (raw)
We cannot cast a phys_addr_t variable to a pointer on 32-bit architectures
with CONFIG_PHYS_ADDR_T_64BIT set:
In file included from include/linux/kernel.h:14:0,
from include/linux/clk.h:16,
from drivers/remoteproc/qcom_q6v5_pil.c:18:
drivers/remoteproc/qcom_q6v5_pil.c: In function 'q6v5_xfer_mem_ownership':
drivers/remoteproc/qcom_q6v5_pil.c:337:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
(void *)addr, (void *)(addr + size),
^
The correct way to print the contents is to use the %pap format
string, passing the phys address by reference.
Fixes: 6c5a9dc2481b ("remoteproc: qcom: Make secure world call for mem ownership switch")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/remoteproc/qcom_q6v5_pil.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c
index 5460f61ee21c..4576f88499cb 100644
--- a/drivers/remoteproc/qcom_q6v5_pil.c
+++ b/drivers/remoteproc/qcom_q6v5_pil.c
@@ -333,9 +333,9 @@ static int q6v5_xfer_mem_ownership(struct q6v5 *qproc, int *current_perm,
ret = qcom_scm_assign_mem(addr, ALIGN(size, SZ_4K),
current_perm, &next, 1);
if (ret < 0) {
- pr_err("Failed to assign memory access in range %p to %p to %s ret = %d\n",
- (void *)addr, (void *)(addr + size),
- remote_owner ? "mss" : "hlos", ret);
+ phys_addr_t end = addr + size;
+ pr_err("Failed to assign memory access in range %pap to %pap to %s ret = %d\n",
+ &addr, &end, remote_owner ? "mss" : "hlos", ret);
return ret;
}
--
2.9.0
next reply other threads:[~2017-11-06 13:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-06 13:37 Arnd Bergmann [this message]
2017-11-07 6:42 ` [PATCH] remoteproc: qcom: use %pap format string for phys_addr_t Bjorn Andersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171106133736.584646-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=akdwived@codeaurora.org \
--cc=andy.gross@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=ohad@wizery.com \
--cc=p.zabel@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox