From: Lucas De Marchi <lucas.demarchi@intel.com>
To: <intel-xe@lists.freedesktop.org>
Cc: "Lucas De Marchi" <lucas.demarchi@intel.com>,
"José Roberto de Souza" <jose.souza@intel.com>,
"kernel test robot" <lkp@intel.com>
Subject: [PATCH] drm/xe/guc: Fix size_t print format
Date: Tue, 28 Jan 2025 07:42:42 -0800 [thread overview]
Message-ID: <20250128154242.3371687-1-lucas.demarchi@intel.com> (raw)
Use %zx format to print size_t to remove the following warning when
building for i386:
include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
518 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
>> drivers/gpu/drm/xe/xe_guc_ct.c:1727:43: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
1727 | drm_printf(p, "[CTB].length: 0x%lx\n", snapshot->ctb_size);
| ~~~ ^~~~~~~~~~~~~~~~~~
| %zx
Cc: José Roberto de Souza <jose.souza@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501281627.H6nj184e-lkp@intel.com/
Fixes: cb1f868ca137 ("drm/xe: Make GUC binaries dump consistent with other binaries in devcoredump")
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
drivers/gpu/drm/xe/xe_guc_ct.c | 2 +-
drivers/gpu/drm/xe/xe_guc_log.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
index 497036675a38c..72ad576fc18eb 100644
--- a/drivers/gpu/drm/xe/xe_guc_ct.c
+++ b/drivers/gpu/drm/xe/xe_guc_ct.c
@@ -1724,7 +1724,7 @@ void xe_guc_ct_snapshot_print(struct xe_guc_ct_snapshot *snapshot,
snapshot->g2h_outstanding);
if (snapshot->ctb) {
- drm_printf(p, "[CTB].length: 0x%lx\n", snapshot->ctb_size);
+ drm_printf(p, "[CTB].length: 0x%zx\n", snapshot->ctb_size);
xe_print_blob_ascii85(p, "[CTB].data", '\n',
snapshot->ctb, 0, snapshot->ctb_size);
}
diff --git a/drivers/gpu/drm/xe/xe_guc_log.c b/drivers/gpu/drm/xe/xe_guc_log.c
index ab97ac728d7a8..80514a446ba28 100644
--- a/drivers/gpu/drm/xe/xe_guc_log.c
+++ b/drivers/gpu/drm/xe/xe_guc_log.c
@@ -204,7 +204,7 @@ void xe_guc_log_snapshot_print(struct xe_guc_log_snapshot *snapshot, struct drm_
drm_printf(p, "GuC timestamp: 0x%08llX [%llu]\n", snapshot->stamp, snapshot->stamp);
drm_printf(p, "Log level: %u\n", snapshot->level);
- drm_printf(p, "[LOG].length: 0x%lx\n", snapshot->size);
+ drm_printf(p, "[LOG].length: 0x%zx\n", snapshot->size);
remain = snapshot->size;
for (i = 0; i < snapshot->num_chunks; i++) {
size_t size = min(GUC_LOG_CHUNK_SIZE, remain);
--
2.48.0
next reply other threads:[~2025-01-28 15:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-28 15:42 Lucas De Marchi [this message]
2025-01-28 16:41 ` ✓ CI.Patch_applied: success for drm/xe/guc: Fix size_t print format Patchwork
2025-01-28 16:41 ` ✗ CI.checkpatch: warning " Patchwork
2025-01-28 16:42 ` ✓ CI.KUnit: success " Patchwork
2025-01-28 16:59 ` ✓ CI.Build: " Patchwork
2025-01-28 17:01 ` ✓ CI.Hooks: " Patchwork
2025-01-28 17:02 ` ✓ CI.checksparse: " Patchwork
2025-01-28 17:22 ` ✓ Xe.CI.BAT: " Patchwork
2025-01-28 22:47 ` [PATCH] " Rodrigo Vivi
2025-01-29 5:41 ` ✗ Xe.CI.Full: failure for " Patchwork
2025-01-29 19:01 ` Lucas De Marchi
2025-01-29 19:26 ` [PATCH] " Summers, Stuart
2025-01-29 19:47 ` Lucas De Marchi
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=20250128154242.3371687-1-lucas.demarchi@intel.com \
--to=lucas.demarchi@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=jose.souza@intel.com \
--cc=lkp@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox