* [PATCH next] ACPICA: AML Parser: Remove spurious precision from format used to dump parse trees
@ 2026-03-26 20:18 david.laight.linux
2026-03-27 9:28 ` Andy Shevchenko
2026-03-27 9:54 ` Petr Mladek
0 siblings, 2 replies; 7+ messages in thread
From: david.laight.linux @ 2026-03-26 20:18 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown, linux-acpi,
acpica-devel, linux-kernel
Cc: David Laight, Masami Hiramatsu, Petr Mladek, Rasmus Villemoes,
Andy Shevchenko, Steven Rostedt, Sergey Senozhatsky,
Andrew Morton
From: David Laight <david.laight.linux@gmail.com>
The debug code in acpi_ps_delete_parse_tree() uses ("%*.s", level * 4, " ")
to indent traces.
POSIX requires the empty precision be treated as zero, but the kernel treats
is as 'no precision specified'.
Change to ("%*s", level * 4, "") since there is additional whitespace and no
reason to indent by one space when level is zero.
Signed-off-by: David Laight <david.laight.linux@gmail.com>
---
drivers/acpi/acpica/pswalk.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/acpi/acpica/pswalk.c b/drivers/acpi/acpica/pswalk.c
index 2f3ebcd8aebe..b1ec75e277ab 100644
--- a/drivers/acpi/acpica/pswalk.c
+++ b/drivers/acpi/acpica/pswalk.c
@@ -49,8 +49,7 @@ void acpi_ps_delete_parse_tree(union acpi_parse_object *subtree_root)
/* This debug option will print the entire parse tree */
- acpi_os_printf(" %*.s%s %p", (level * 4),
- " ",
+ acpi_os_printf(" %*s%s %p", (level * 4), "",
acpi_ps_get_opcode_name(op->
common.
aml_opcode),
--
2.39.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH next] ACPICA: AML Parser: Remove spurious precision from format used to dump parse trees
2026-03-26 20:18 [PATCH next] ACPICA: AML Parser: Remove spurious precision from format used to dump parse trees david.laight.linux
@ 2026-03-27 9:28 ` Andy Shevchenko
2026-03-27 9:45 ` David Laight
2026-03-27 9:54 ` Petr Mladek
1 sibling, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2026-03-27 9:28 UTC (permalink / raw)
To: david.laight.linux
Cc: Rafael J. Wysocki, Robert Moore, Len Brown, linux-acpi,
acpica-devel, linux-kernel, Masami Hiramatsu, Petr Mladek,
Rasmus Villemoes, Steven Rostedt, Sergey Senozhatsky,
Andrew Morton
On Thu, Mar 26, 2026 at 08:18:30PM +0000, david.laight.linux@gmail.com wrote:
> The debug code in acpi_ps_delete_parse_tree() uses ("%*.s", level * 4, " ")
> to indent traces.
> POSIX requires the empty precision be treated as zero, but the kernel treats
> is as 'no precision specified'.
> Change to ("%*s", level * 4, "") since there is additional whitespace and no
> reason to indent by one space when level is zero.
This is cross-platform code. Does the same applies to MS VC compiler, for
example?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH next] ACPICA: AML Parser: Remove spurious precision from format used to dump parse trees
2026-03-27 9:28 ` Andy Shevchenko
@ 2026-03-27 9:45 ` David Laight
2026-03-27 9:58 ` Rafael J. Wysocki
0 siblings, 1 reply; 7+ messages in thread
From: David Laight @ 2026-03-27 9:45 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Rafael J. Wysocki, Robert Moore, Len Brown, linux-acpi,
acpica-devel, linux-kernel, Masami Hiramatsu, Petr Mladek,
Rasmus Villemoes, Steven Rostedt, Sergey Senozhatsky,
Andrew Morton
On Fri, 27 Mar 2026 11:28:26 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> On Thu, Mar 26, 2026 at 08:18:30PM +0000, david.laight.linux@gmail.com wrote:
>
> > The debug code in acpi_ps_delete_parse_tree() uses ("%*.s", level * 4, " ")
> > to indent traces.
> > POSIX requires the empty precision be treated as zero, but the kernel treats
> > is as 'no precision specified'.
> > Change to ("%*s", level * 4, "") since there is additional whitespace and no
> > reason to indent by one space when level is zero.
>
> This is cross-platform code. Does the same applies to MS VC compiler, for
> example?
>
Everything except the linux kernel will treat "%*.s" as "%*.0s".
Regardless of anything else specifying a 'precision' when printing
a constant string is entirely pointless - it limits the number of
characters copied from the string.
Basically "%*.s" is always a typo, either for "%.*s" or "%*s".
David
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH next] ACPICA: AML Parser: Remove spurious precision from format used to dump parse trees
2026-03-26 20:18 [PATCH next] ACPICA: AML Parser: Remove spurious precision from format used to dump parse trees david.laight.linux
2026-03-27 9:28 ` Andy Shevchenko
@ 2026-03-27 9:54 ` Petr Mladek
1 sibling, 0 replies; 7+ messages in thread
From: Petr Mladek @ 2026-03-27 9:54 UTC (permalink / raw)
To: david.laight.linux
Cc: Rafael J. Wysocki, Robert Moore, Len Brown, linux-acpi,
acpica-devel, linux-kernel, Masami Hiramatsu, Rasmus Villemoes,
Andy Shevchenko, Steven Rostedt, Sergey Senozhatsky,
Andrew Morton
On Thu 2026-03-26 20:18:30, david.laight.linux@gmail.com wrote:
> From: David Laight <david.laight.linux@gmail.com>
>
> The debug code in acpi_ps_delete_parse_tree() uses ("%*.s", level * 4, " ")
> to indent traces.
> POSIX requires the empty precision be treated as zero, but the kernel treats
> is as 'no precision specified'.
> Change to ("%*s", level * 4, "") since there is additional whitespace and no
> reason to indent by one space when level is zero.
>
> --- a/drivers/acpi/acpica/pswalk.c
> +++ b/drivers/acpi/acpica/pswalk.c
> @@ -49,8 +49,7 @@ void acpi_ps_delete_parse_tree(union acpi_parse_object *subtree_root)
>
> /* This debug option will print the entire parse tree */
>
> - acpi_os_printf(" %*.s%s %p", (level * 4),
> - " ",
> + acpi_os_printf(" %*s%s %p", (level * 4), "",
> acpi_ps_get_opcode_name(op->
> common.
> aml_opcode),
The change has no visible effect. The precision defines how many
characters are copied from the given string. It does not matter
here because the given string is empty "". The number of added
spaces ' ' is defined by the field width parameter (level * 4).
Anyway, the change makes sense:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH next] ACPICA: AML Parser: Remove spurious precision from format used to dump parse trees
2026-03-27 9:45 ` David Laight
@ 2026-03-27 9:58 ` Rafael J. Wysocki
2026-03-27 10:58 ` David Laight
0 siblings, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2026-03-27 9:58 UTC (permalink / raw)
To: David Laight
Cc: Andy Shevchenko, Rafael J. Wysocki, Robert Moore, Len Brown,
linux-acpi, acpica-devel, linux-kernel, Masami Hiramatsu,
Petr Mladek, Rasmus Villemoes, Steven Rostedt, Sergey Senozhatsky,
Andrew Morton
On Fri, Mar 27, 2026 at 10:45 AM David Laight
<david.laight.linux@gmail.com> wrote:
>
> On Fri, 27 Mar 2026 11:28:26 +0200
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
>
> > On Thu, Mar 26, 2026 at 08:18:30PM +0000, david.laight.linux@gmail.com wrote:
> >
> > > The debug code in acpi_ps_delete_parse_tree() uses ("%*.s", level * 4, " ")
> > > to indent traces.
> > > POSIX requires the empty precision be treated as zero, but the kernel treats
> > > is as 'no precision specified'.
> > > Change to ("%*s", level * 4, "") since there is additional whitespace and no
> > > reason to indent by one space when level is zero.
> >
> > This is cross-platform code. Does the same applies to MS VC compiler, for
> > example?
> >
>
> Everything except the linux kernel will treat "%*.s" as "%*.0s".
>
> Regardless of anything else specifying a 'precision' when printing
> a constant string is entirely pointless - it limits the number of
> characters copied from the string.
>
> Basically "%*.s" is always a typo, either for "%.*s" or "%*s".
So this change should be made in upstream ACPICA in the first place as
per Documentation/driver-api/acpi/linuxized-acpica.rst.
Would you please send a PR to the upstream ACPICA project on GH?
Alternatively, someone else may make that change upstream with a
Suggested-by tag pointing to you.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH next] ACPICA: AML Parser: Remove spurious precision from format used to dump parse trees
2026-03-27 9:58 ` Rafael J. Wysocki
@ 2026-03-27 10:58 ` David Laight
2026-03-27 11:17 ` Rafael J. Wysocki
0 siblings, 1 reply; 7+ messages in thread
From: David Laight @ 2026-03-27 10:58 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Andy Shevchenko, Robert Moore, Len Brown, linux-acpi,
acpica-devel, linux-kernel, Masami Hiramatsu, Petr Mladek,
Rasmus Villemoes, Steven Rostedt, Sergey Senozhatsky,
Andrew Morton
On Fri, 27 Mar 2026 10:58:14 +0100
"Rafael J. Wysocki" <rafael@kernel.org> wrote:
> On Fri, Mar 27, 2026 at 10:45 AM David Laight
> <david.laight.linux@gmail.com> wrote:
> >
> > On Fri, 27 Mar 2026 11:28:26 +0200
> > Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> >
> > > On Thu, Mar 26, 2026 at 08:18:30PM +0000, david.laight.linux@gmail.com wrote:
> > >
> > > > The debug code in acpi_ps_delete_parse_tree() uses ("%*.s", level * 4, " ")
> > > > to indent traces.
> > > > POSIX requires the empty precision be treated as zero, but the kernel treats
> > > > is as 'no precision specified'.
> > > > Change to ("%*s", level * 4, "") since there is additional whitespace and no
> > > > reason to indent by one space when level is zero.
> > >
> > > This is cross-platform code. Does the same applies to MS VC compiler, for
> > > example?
> > >
> >
> > Everything except the linux kernel will treat "%*.s" as "%*.0s".
> >
> > Regardless of anything else specifying a 'precision' when printing
> > a constant string is entirely pointless - it limits the number of
> > characters copied from the string.
> >
> > Basically "%*.s" is always a typo, either for "%.*s" or "%*s".
>
> So this change should be made in upstream ACPICA in the first place as
> per Documentation/driver-api/acpi/linuxized-acpica.rst.
>
> Would you please send a PR to the upstream ACPICA project on GH?
I'd have to go through a lot of hoops to do that.
I've never used GH.
David
> Alternatively, someone else may make that change upstream with a
> Suggested-by tag pointing to you.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH next] ACPICA: AML Parser: Remove spurious precision from format used to dump parse trees
2026-03-27 10:58 ` David Laight
@ 2026-03-27 11:17 ` Rafael J. Wysocki
0 siblings, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2026-03-27 11:17 UTC (permalink / raw)
To: David Laight
Cc: Rafael J. Wysocki, Andy Shevchenko, Robert Moore, Len Brown,
linux-acpi, acpica-devel, linux-kernel, Masami Hiramatsu,
Petr Mladek, Rasmus Villemoes, Steven Rostedt, Sergey Senozhatsky,
Andrew Morton
On Fri, Mar 27, 2026 at 11:58 AM David Laight
<david.laight.linux@gmail.com> wrote:
>
> On Fri, 27 Mar 2026 10:58:14 +0100
> "Rafael J. Wysocki" <rafael@kernel.org> wrote:
>
> > On Fri, Mar 27, 2026 at 10:45 AM David Laight
> > <david.laight.linux@gmail.com> wrote:
> > >
> > > On Fri, 27 Mar 2026 11:28:26 +0200
> > > Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> > >
> > > > On Thu, Mar 26, 2026 at 08:18:30PM +0000, david.laight.linux@gmail.com wrote:
> > > >
> > > > > The debug code in acpi_ps_delete_parse_tree() uses ("%*.s", level * 4, " ")
> > > > > to indent traces.
> > > > > POSIX requires the empty precision be treated as zero, but the kernel treats
> > > > > is as 'no precision specified'.
> > > > > Change to ("%*s", level * 4, "") since there is additional whitespace and no
> > > > > reason to indent by one space when level is zero.
> > > >
> > > > This is cross-platform code. Does the same applies to MS VC compiler, for
> > > > example?
> > > >
> > >
> > > Everything except the linux kernel will treat "%*.s" as "%*.0s".
> > >
> > > Regardless of anything else specifying a 'precision' when printing
> > > a constant string is entirely pointless - it limits the number of
> > > characters copied from the string.
> > >
> > > Basically "%*.s" is always a typo, either for "%.*s" or "%*s".
> >
> > So this change should be made in upstream ACPICA in the first place as
> > per Documentation/driver-api/acpi/linuxized-acpica.rst.
> >
> > Would you please send a PR to the upstream ACPICA project on GH?
>
> I'd have to go through a lot of hoops to do that.
> I've never used GH.
OK, we'll go for the second option then.
> > Alternatively, someone else may make that change upstream with a
> > Suggested-by tag pointing to you.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-03-27 11:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-26 20:18 [PATCH next] ACPICA: AML Parser: Remove spurious precision from format used to dump parse trees david.laight.linux
2026-03-27 9:28 ` Andy Shevchenko
2026-03-27 9:45 ` David Laight
2026-03-27 9:58 ` Rafael J. Wysocki
2026-03-27 10:58 ` David Laight
2026-03-27 11:17 ` Rafael J. Wysocki
2026-03-27 9:54 ` Petr Mladek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox