[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f846343a-49ac-443f-bef3-04e3e08ee20c@gmail.com>
Date: Wed, 14 Jan 2026 04:49:32 -0400
From: Vivek BalachandharTN <vivek.balachandhar@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...el.com>
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH] input: byd: use %*ph for Z packet dump
Thanks Andy — good point. Packet length is fixed here, so |%4ph| is
better. I’ll follow this pattern in future patches (and can send a small
follow-up to adjust this one if desired).
Best, Vivek
On 2026-01-14 3:37 a.m., Andy Shevchenko wrote:
> On Tue, Dec 02, 2025 at 03:31:20AM +0000, Vivek BalachandharTN wrote:
>> Replace the hand-rolled %02x formatting of the Z packet warning in the
>> BYD driver with the %*ph format specifier. %*ph is the preferred helper
>> for printing a buffer in hexadecimal and makes the logging clearer and
>> more consistent.
> You probably took one of the oldest examples of such a conversion done in
> the input subsystem.
>
>> + "Unrecognized Z: pkt = %*ph\n",
>> + 4, psmouse->packet);
> The (not-so-critical) problem here is the stack consumption and additional work
> for the printf() to parse '*'. To optimise that, static field widths may be
> embedded in the format strings
>
> "Unrecognized Z: pkt = %4ph\n",
> psmouse->packet);
>
Powered by blists - more mailing lists