public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
From: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@intel.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 04:49:32 -0400	[thread overview]
Message-ID: <f846343a-49ac-443f-bef3-04e3e08ee20c@gmail.com> (raw)
In-Reply-To: <aWdHsalXcjFKmDDK@black.igk.intel.com>

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);
>

  reply	other threads:[~2026-01-14  8:49 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
2026-01-14  8:49   ` Vivek BalachandharTN [this message]
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=f846343a-49ac-443f-bef3-04e3e08ee20c@gmail.com \
    --to=vivek.balachandhar@gmail.com \
    --cc=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 \
    /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