Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Bernatowicz, Marcin" <marcin.bernatowicz@linux.intel.com>
To: Jan Sokolowski <jan.sokolowski@intel.com>, igt-dev@lists.freedesktop.org
Cc: Lukasz Laguna <lukasz.laguna@intel.com>
Subject: Re: [PATCH i-g-t v2 5/8] lib/xe/xe_sriov*: fixup print/scan formatting for files in lib
Date: Fri, 23 May 2025 15:21:57 +0200	[thread overview]
Message-ID: <049cff66-d288-4972-b2a6-b9a6a70cf41f@linux.intel.com> (raw)
In-Reply-To: <20250519113010.125751-6-jan.sokolowski@intel.com>



On 5/19/2025 1:30 PM, Jan Sokolowski wrote:
> Compiling on other architectures than x86-64 causes a lot
> of print/scan formatting warnings.
> 
> Fix formatting by using proper formatters, eg. SCNu64.
> 
> Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com>
> Cc: Lukasz Laguna <lukasz.laguna@intel.com>
> Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
> ---
>   lib/xe/xe_sriov_debugfs.c      | 18 +++++++++---------
>   lib/xe/xe_sriov_provisioning.c |  2 +-
>   2 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/lib/xe/xe_sriov_debugfs.c b/lib/xe/xe_sriov_debugfs.c
> index 8f30fa312..9b743f657 100644
> --- a/lib/xe/xe_sriov_debugfs.c
> +++ b/lib/xe/xe_sriov_debugfs.c
> @@ -105,18 +105,18 @@ static int parse_provisioned_range(const char *line,
>   	switch (res) {
>   	case XE_SRIOV_SHARED_RES_CONTEXTS:
>   	case XE_SRIOV_SHARED_RES_DOORBELLS:
> -		if (sscanf(line, "VF%u: %lu-%lu", &range->vf_id, &range->start, &range->end) == 3)
> +		if (sscanf(line, "VF%u: %" SCNu64 "-%" SCNu64, &range->vf_id, &range->start, &range->end) == 3)
>   			ret = 0;
>   		break;
>   	case XE_SRIOV_SHARED_RES_GGTT:
> -		if (sscanf(line, "VF%u: %lx-%lx", &range->vf_id, &range->start, &range->end) == 3)
> +		if (sscanf(line, "VF%u: %" SCNx64 "-%" SCNx64, &range->vf_id, &range->start, &range->end) == 3)
>   			ret = 0;
>   		break;
>   	case XE_SRIOV_SHARED_RES_LMEM:
>   		/* Convert to an inclusive range as is the case for other resources.
>   		 * The start is always 0 and the end is the value read - 1.
>   		 */
> -		if (sscanf(line, "VF%u: %lu", &range->vf_id, &range->end) == 2)
> +		if (sscanf(line, "VF%u: %" SCNu64, &range->vf_id, &range->end) == 2)
>   			ret = 0;
>   		if (!range->end)
>   			return -1;
> @@ -232,8 +232,8 @@ static int validate_vf_ids(enum xe_sriov_shared_res res,
>   				  nr_ranges);
>   			for (unsigned int i = 0; i < limit; i++) {
>   				igt_debug((res == XE_SRIOV_SHARED_RES_GGTT) ?
> -						  "%s:VF%u: %lx-%lx\n" :
> -						  "%s:VF%u: %lu-%lu\n",
> +						  "%s:VF%u: %" PRIx64 "-%" PRIx64 "\n" :
> +						  "%s:VF%u: %" PRIu64 "-%" PRIu64 "\n",
>   					  xe_sriov_shared_res_to_string(res),
>   					  ranges[i].vf_id, ranges[i].start, ranges[i].end);
>   			}
> @@ -504,16 +504,16 @@ int __xe_sriov_vf_debugfs_get_selfconfig(int vf, enum xe_sriov_shared_res res,
>   	while (getline(&line, &n, file) >= 0) {
>   		switch (res) {
>   		case XE_SRIOV_SHARED_RES_CONTEXTS:
> -			ret = sscanf(line, "GuC contexts: %lu", value);
> +			ret = sscanf(line, "GuC contexts: %" SCNu64, value);
>   			break;
>   		case XE_SRIOV_SHARED_RES_DOORBELLS:
> -			ret = sscanf(line, "GuC doorbells: %lu", value);
> +			ret = sscanf(line, "GuC doorbells: %" SCNu64, value);
>   			break;
>   		case XE_SRIOV_SHARED_RES_GGTT:
> -			ret = sscanf(line, "GGTT size: %lu", value);
> +			ret = sscanf(line, "GGTT size: %" SCNu64, value);
>   			break;
>   		case XE_SRIOV_SHARED_RES_LMEM:
> -			ret = sscanf(line, "LMEM size: %lu", value);
> +			ret = sscanf(line, "LMEM size: %" SCNu64, value);
>   			break;
>   		}
>   
> diff --git a/lib/xe/xe_sriov_provisioning.c b/lib/xe/xe_sriov_provisioning.c
> index aa265247e..2a02f7cc8 100644
> --- a/lib/xe/xe_sriov_provisioning.c
> +++ b/lib/xe/xe_sriov_provisioning.c
> @@ -75,7 +75,7 @@ static int append_range(struct xe_sriov_provisioned_range **ranges,
>   
>   	*ranges = new_ranges;
>   	if (*nr_ranges < MAX_DEBUG_ENTRIES)
> -		igt_debug("Found VF%u GGTT range [%#x-%#x] num_ptes=%ld\n",
> +		igt_debug("Found VF%u GGTT range [%#x-%#x] num_ptes=%zu\n",
>   			  vf_id, start, end,
>   			  (end - start + sizeof(xe_ggtt_pte_t)) /
>   			  sizeof(xe_ggtt_pte_t));
LGTM,
Reviewed-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>

  reply	other threads:[~2025-05-23 13:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-19 11:30 [PATCH i-g-t v2 0/8] Print/scan formatting fixups Jan Sokolowski
2025-05-19 11:30 ` [PATCH i-g-t v2 1/8] lib/amdgpu: fixup print/scan formatting for files in lib Jan Sokolowski
2025-05-19 11:30 ` [PATCH i-g-t v2 2/8] tests/amdgpu: fixup print/scan formatting for files in tests Jan Sokolowski
2025-05-19 11:30 ` [PATCH i-g-t v2 3/8] lib/igt_nouveau: fixup print/scan formatting for files in lib Jan Sokolowski
2025-05-19 11:30 ` [PATCH i-g-t v2 4/8] lib/igt_perf: " Jan Sokolowski
2025-05-19 11:30 ` [PATCH i-g-t v2 5/8] lib/xe/xe_sriov*: " Jan Sokolowski
2025-05-23 13:21   ` Bernatowicz, Marcin [this message]
2025-05-19 11:30 ` [PATCH i-g-t v2 6/8] tests/intel/xe_sriov*: fixup print/scan formatting for files in tests Jan Sokolowski
2025-05-23 13:33   ` Bernatowicz, Marcin
2025-05-19 11:30 ` [PATCH i-g-t v2 7/8] runner: fixup print/scan formatting for files in runner Jan Sokolowski
2025-05-19 18:42   ` Kamil Konieczny
2025-05-19 11:30 ` [PATCH i-g-t v2 8/8] tests/intel: fixup print/scan formatting for files in intel tests Jan Sokolowski
2025-05-19 20:14 ` ✓ Xe.CI.BAT: success for Print/scan formatting fixups (rev2) Patchwork
2025-05-19 20:19 ` ✓ i915.CI.BAT: " Patchwork
2025-05-20  0:59 ` ✗ i915.CI.Full: failure " Patchwork
2025-05-20  2:38 ` ✗ Xe.CI.Full: " Patchwork

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=049cff66-d288-4972-b2a6-b9a6a70cf41f@linux.intel.com \
    --to=marcin.bernatowicz@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jan.sokolowski@intel.com \
    --cc=lukasz.laguna@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