[PATCH] drm/xe/guc: Fix size_t print format

Lucas De Marchi lucas.demarchi at intel.com
Wed Jan 29 19:47:07 UTC 2025


On Wed, Jan 29, 2025 at 01:26:25PM -0600, Stuart Summers wrote:
>On Tue, 2025-01-28 at 07:42 -0800, Lucas De Marchi wrote:
>> 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 at intel.com>
>> Reported-by: kernel test robot <lkp at 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 at intel.com>
>
>Reviewed-by: Stuart Summers <stuart.summers at intel.com>

sorry, I pushed that a little bit before getting t this.


>
>For the test failure, looks like a ci-buglog issue not reporting the
>right logs...
>
>[763.452445] [114/122] (681s left) xe_drm_fdinfo (utilization-others-
>idle)
>[763.517537] Starting subtest: utilization-others-idle
>[770.545124] Subtest utilization-others-idle: SUCCESS (7.026s)
>
>Test seems fine.

yep... wondering if this is a one-of or if we have more similar cases
happening.

Lucas De Marchi

>
>> ---
>>  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);
>


More information about the Intel-xe mailing list