All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Aibing Chen <chenaibing@cmss.chinamobile.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: adi - use scnprintf() for the device name
Date: Wed, 25 Nov 2026 21:42:25 -0800	[thread overview]
Message-ID: <awfGt6HfOVgT1H8R@google.com> (raw)
In-Reply-To: <20261126053234.455-1-chenaibing@cmss.chinamobile.com>

On Thu, Nov 26, 2026 at 01:32:34PM +0800, Aibing Chen wrote:
> adi_init_input() composes the device name as "Logitech %s [%s]" from the
> model string in buf[] and the controller name in adi->cname, into a 64
> byte array.  buf can hold up to 63 characters and cname up to 15, so the
> composed name can reach 90 bytes and does not fit.  The name is
> informational and truncating it is acceptable, but the call site does not
> say so.
> 
> Building with W=1, where -Wformat-truncation is enabled, the file does not
> build today; COMPILE_TEST configurations additionally turn the warning
> into an error through CONFIG_WERROR:
> 
>   drivers/input/joystick/adi.c:395:60: error: '%s' directive output may be
>     truncated writing up to 63 bytes into a region of size 55
>     [-Werror=format-truncation=]
> 
> Use scnprintf(), the helper that expresses a bounded, truncation tolerant
> write, so that the file builds warning free and the intent is visible at
> the call site.
> 
> No functional change.
> 
> Signed-off-by: Aibing Chen <chenaibing@cmss.chinamobile.com>

Applied, thank you.

-- 
Dmitry

      parent reply	other threads:[~2026-11-26  5:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  5:32 [PATCH] Input: adi - use scnprintf() for the device name Aibing Chen
2026-11-26  5:36 ` sashiko-bot
2026-11-26  5:42 ` Dmitry Torokhov [this message]

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=awfGt6HfOVgT1H8R@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=chenaibing@cmss.chinamobile.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.