From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH] input: byd: use %*ph for Z packet dump
Date: Wed, 14 Jan 2026 08:37:21 +0100 [thread overview]
Message-ID: <aWdHsalXcjFKmDDK@black.igk.intel.com> (raw)
In-Reply-To: <20251202033120.2264474-1-vivek.balachandhar@gmail.com>
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);
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-01-14 7:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-02 3:31 [PATCH] input: byd: use %*ph for Z packet dump Vivek BalachandharTN
2025-12-09 5:43 ` Dmitry Torokhov
2026-01-14 7:37 ` Andy Shevchenko [this message]
2026-01-14 8:49 ` Vivek BalachandharTN
2026-01-14 8:53 ` Andy Shevchenko
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=aWdHsalXcjFKmDDK@black.igk.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=vivek.balachandhar@gmail.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 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.