From: Arnd Bergmann <arnd@kernel.org>
To: "Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"David Airlie" <airlied@gmail.com>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Felix Kuehling" <Felix.Kuehling@amd.com>,
"Rajneesh Bhardwaj" <rajneesh.bhardwaj@amd.com>,
"Harish Kasiviswanathan" <Harish.Kasiviswanathan@amd.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
Le Ma <le.ma@amd.com>,
amd-gfx@lists.freedesktop.org,
Hawking Zhang <Hawking.Zhang@amd.com>
Subject: [PATCH 4/5] drm/amdgpu: use %pad format string for dma_addr_t
Date: Mon, 22 May 2023 13:50:31 +0200 [thread overview]
Message-ID: <20230522115047.1169839-4-arnd@kernel.org> (raw)
In-Reply-To: <20230522115047.1169839-1-arnd@kernel.org>
From: Arnd Bergmann <arnd@arndb.de>
DMA addresses can be shorter than u64, which results in a broken debug output:
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c: In function 'amdgpu_gart_table_ram_alloc':
drivers/gpu/drm/amd/amdgpu/amdgpu.h:41:22: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'} [-Werror=format=]
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c:146:9: note: in expansion of macro 'dev_info'
146 | dev_info(adev->dev, "%s dma_addr:%llx\n", __func__, dma_addr);
Use the special %pad format string and pass the DMA address by reference.
Fixes: d020a29b6b58 ("drm/amdgpu: Allocate GART table in RAM for AMD APU")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c
index a070adf30c88..73b8cca35bab 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c
@@ -143,7 +143,7 @@ int amdgpu_gart_table_ram_alloc(struct amdgpu_device *adev)
return -EFAULT;
}
- dev_info(adev->dev, "%s dma_addr:%llx\n", __func__, dma_addr);
+ dev_info(adev->dev, "%s dma_addr:%pad\n", __func__, &dma_addr);
/* Create SG table */
sg = kmalloc(sizeof(*sg), GFP_KERNEL);
if (!sg) {
--
2.39.2
WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@kernel.org>
To: "Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"David Airlie" <airlied@gmail.com>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Felix Kuehling" <Felix.Kuehling@amd.com>,
"Rajneesh Bhardwaj" <rajneesh.bhardwaj@amd.com>,
"Harish Kasiviswanathan" <Harish.Kasiviswanathan@amd.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Hawking Zhang <Hawking.Zhang@amd.com>, Le Ma <le.ma@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 4/5] drm/amdgpu: use %pad format string for dma_addr_t
Date: Mon, 22 May 2023 13:50:31 +0200 [thread overview]
Message-ID: <20230522115047.1169839-4-arnd@kernel.org> (raw)
In-Reply-To: <20230522115047.1169839-1-arnd@kernel.org>
From: Arnd Bergmann <arnd@arndb.de>
DMA addresses can be shorter than u64, which results in a broken debug output:
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c: In function 'amdgpu_gart_table_ram_alloc':
drivers/gpu/drm/amd/amdgpu/amdgpu.h:41:22: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'} [-Werror=format=]
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c:146:9: note: in expansion of macro 'dev_info'
146 | dev_info(adev->dev, "%s dma_addr:%llx\n", __func__, dma_addr);
Use the special %pad format string and pass the DMA address by reference.
Fixes: d020a29b6b58 ("drm/amdgpu: Allocate GART table in RAM for AMD APU")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c
index a070adf30c88..73b8cca35bab 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c
@@ -143,7 +143,7 @@ int amdgpu_gart_table_ram_alloc(struct amdgpu_device *adev)
return -EFAULT;
}
- dev_info(adev->dev, "%s dma_addr:%llx\n", __func__, dma_addr);
+ dev_info(adev->dev, "%s dma_addr:%pad\n", __func__, &dma_addr);
/* Create SG table */
sg = kmalloc(sizeof(*sg), GFP_KERNEL);
if (!sg) {
--
2.39.2
next prev parent reply other threads:[~2023-05-22 11:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-22 11:50 [PATCH 1/5] drm/amd/pm: mark irq functions as 'static' Arnd Bergmann
2023-05-22 11:50 ` Arnd Bergmann
2023-05-22 11:50 ` [PATCH 2/5] drm/amdkfd: mark local functions as static Arnd Bergmann
2023-05-22 11:50 ` Arnd Bergmann
2023-05-22 11:50 ` [PATCH 3/5] drm/amdgpu:mark aqua_vanjaram_reg_init.c function " Arnd Bergmann
2023-05-22 11:50 ` Arnd Bergmann
2023-05-22 11:50 ` Arnd Bergmann [this message]
2023-05-22 11:50 ` [PATCH 4/5] drm/amdgpu: use %pad format string for dma_addr_t Arnd Bergmann
2023-05-22 11:50 ` [PATCH 5/5] drm/amdgpu: fix acpi build warnings Arnd Bergmann
2023-05-22 11:50 ` Arnd Bergmann
2023-05-22 15:08 ` Alex Deucher
2023-05-22 15:08 ` Alex Deucher
2023-05-22 15:08 ` Alex Deucher
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=20230522115047.1169839-4-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=Felix.Kuehling@amd.com \
--cc=Harish.Kasiviswanathan@amd.com \
--cc=Hawking.Zhang@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=arnd@arndb.de \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=le.ma@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rajneesh.bhardwaj@amd.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.