All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/vpmu: Fix incorrect printk format specifiers
@ 2026-09-21  9:16 Alejandro Vallejo
  2026-09-21  9:30 ` Andrew Cooper
  0 siblings, 1 reply; 5+ messages in thread
From: Alejandro Vallejo @ 2026-09-21  9:16 UTC (permalink / raw)
  To: xen-devel
  Cc: Alejandro Vallejo, Jan Beulich, Andrew Cooper,
	Roger Pau Monné, Teddy Astie

The patch in Fixes adjusted two vendor variables from uint8_t and plain
int to to unsigned int. But they were both used later in printks with
the %d specifier rather than %u. Adjust accordingly.

Fixes: 39a9a49449d7 ("x86: Remove x86 prefixed names from x86/cpu/ files")
Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
---
 xen/arch/x86/cpu/vpmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index 470f5ec98d..e0f7edded3 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -417,7 +417,7 @@ static int vpmu_arch_initialise(struct vcpu *v)
     {
         if ( vpmu_mode != XENPMU_MODE_OFF )
         {
-            printk(XENLOG_G_WARNING "VPMU: Unknown CPU vendor %d. "
+            printk(XENLOG_G_WARNING "VPMU: Unknown CPU vendor %u. "
                    "Disabling VPMU\n", vendor);
             opt_vpmu_enabled = 0;
             vpmu_mode = XENPMU_MODE_OFF;
@@ -849,7 +849,7 @@ static int __init cf_check vpmu_init(void)
 #endif
 
     default:
-        printk(XENLOG_WARNING "VPMU: Unknown CPU vendor: %d. "
+        printk(XENLOG_WARNING "VPMU: Unknown CPU vendor: %u. "
                "Turning VPMU off.\n", vendor);
         break;
     }

base-commit: adbbbd47a1fad8e3bc1ab65c555f11d831fd6681
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/vpmu: Fix incorrect printk format specifiers
  2026-09-21  9:16 [PATCH] x86/vpmu: Fix incorrect printk format specifiers Alejandro Vallejo
@ 2026-09-21  9:30 ` Andrew Cooper
  2026-09-21 10:33   ` Alejandro Vallejo
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cooper @ 2026-09-21  9:30 UTC (permalink / raw)
  To: Alejandro Vallejo, xen-devel
  Cc: Andrew Cooper, Jan Beulich, Roger Pau Monné, Teddy Astie

On 21/09/2026 10:16 am, Alejandro Vallejo wrote:
> The patch in Fixes adjusted two vendor variables from uint8_t and plain
> int to to unsigned int. But they were both used later in printks with
> the %d specifier rather than %u. Adjust accordingly.
>
> Fixes: 39a9a49449d7 ("x86: Remove x86 prefixed names from x86/cpu/ files")
> Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>

If this is going to be a problem, then shouldn't we turn
-Wformat-signedness on?

For the patch, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/vpmu: Fix incorrect printk format specifiers
  2026-09-21  9:30 ` Andrew Cooper
@ 2026-09-21 10:33   ` Alejandro Vallejo
  2026-09-21 15:59     ` Andrew Cooper
  0 siblings, 1 reply; 5+ messages in thread
From: Alejandro Vallejo @ 2026-09-21 10:33 UTC (permalink / raw)
  To: Andrew Cooper, xen-devel; +Cc: Jan Beulich, Roger Pau Monné, Teddy Astie

On Mon Sep 21, 2026 at 11:30 AM CEST, Andrew Cooper wrote:
> On 21/09/2026 10:16 am, Alejandro Vallejo wrote:
> > The patch in Fixes adjusted two vendor variables from uint8_t and plain
> > int to to unsigned int. But they were both used later in printks with
> > the %d specifier rather than %u. Adjust accordingly.
> >
> > Fixes: 39a9a49449d7 ("x86: Remove x86 prefixed names from x86/cpu/ files")
> > Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
>
> If this is going to be a problem, then shouldn't we turn
> -Wformat-signedness on?

I tried that before sending, but that needs a whole new series. Things
are not quite as clean as I'd hope.

>
> For the patch, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks

Alejandro


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/vpmu: Fix incorrect printk format specifiers
  2026-09-21 10:33   ` Alejandro Vallejo
@ 2026-09-21 15:59     ` Andrew Cooper
  2026-09-21 17:31       ` Alejandro Vallejo
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cooper @ 2026-09-21 15:59 UTC (permalink / raw)
  To: Alejandro Vallejo, xen-devel
  Cc: Andrew Cooper, Jan Beulich, Roger Pau Monné, Teddy Astie

On 21/09/2026 11:33 am, Alejandro Vallejo wrote:
> On Mon Sep 21, 2026 at 11:30 AM CEST, Andrew Cooper wrote:
>> On 21/09/2026 10:16 am, Alejandro Vallejo wrote:
>>> The patch in Fixes adjusted two vendor variables from uint8_t and plain
>>> int to to unsigned int. But they were both used later in printks with
>>> the %d specifier rather than %u. Adjust accordingly.
>>>
>>> Fixes: 39a9a49449d7 ("x86: Remove x86 prefixed names from x86/cpu/ files")
>>> Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
>> If this is going to be a problem, then shouldn't we turn
>> -Wformat-signedness on?
> I tried that before sending, but that needs a whole new series. Things
> are not quite as clean as I'd hope.

Well, it's going to keep on regressing until -Wformat-signedness is in
place.

~Andrew


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/vpmu: Fix incorrect printk format specifiers
  2026-09-21 15:59     ` Andrew Cooper
@ 2026-09-21 17:31       ` Alejandro Vallejo
  0 siblings, 0 replies; 5+ messages in thread
From: Alejandro Vallejo @ 2026-09-21 17:31 UTC (permalink / raw)
  To: Andrew Cooper, xen-devel; +Cc: Jan Beulich, Roger Pau Monné, Teddy Astie

On Mon Sep 21, 2026 at 5:59 PM CEST, Andrew Cooper wrote:
> On 21/09/2026 11:33 am, Alejandro Vallejo wrote:
> > On Mon Sep 21, 2026 at 11:30 AM CEST, Andrew Cooper wrote:
> >> On 21/09/2026 10:16 am, Alejandro Vallejo wrote:
> >>> The patch in Fixes adjusted two vendor variables from uint8_t and plain
> >>> int to to unsigned int. But they were both used later in printks with
> >>> the %d specifier rather than %u. Adjust accordingly.
> >>>
> >>> Fixes: 39a9a49449d7 ("x86: Remove x86 prefixed names from x86/cpu/ files")
> >>> Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
> >> If this is going to be a problem, then shouldn't we turn
> >> -Wformat-signedness on?
> > I tried that before sending, but that needs a whole new series. Things
> > are not quite as clean as I'd hope.
>
> Well, it's going to keep on regressing until -Wformat-signedness is in
> place.
>
> ~Andrew

In case it wasn't obvious, I agree. I just happened to bump into these
while refactoring that general area for another series and I'd rather
fix them separately rather than bundling it in a 15+ patch series. 

In due course it shall be done.

Cheers,
Alejandro


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-09-21 17:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-21  9:16 [PATCH] x86/vpmu: Fix incorrect printk format specifiers Alejandro Vallejo
2026-09-21  9:30 ` Andrew Cooper
2026-09-21 10:33   ` Alejandro Vallejo
2026-09-21 15:59     ` Andrew Cooper
2026-09-21 17:31       ` Alejandro Vallejo

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.