From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Francesco Lavra <flavra@baylibre.com>
Cc: "Lorenzo Bianconi" <lorenzo@kernel.org>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] iio: imu: st_lsm6dsx: add support for rotation sensor
Date: Tue, 20 Jan 2026 11:36:05 +0200 [thread overview]
Message-ID: <aW9MhYO_xhlQXFn2@smile.fi.intel.com> (raw)
In-Reply-To: <851180c6f41f8c9cc79d6412eb97f381f0312f00.camel@baylibre.com>
On Tue, Jan 20, 2026 at 10:28:15AM +0100, Francesco Lavra wrote:
> On Mon, 2026-01-19 at 12:33 +0200, Andy Shevchenko wrote:
> > On Mon, Jan 19, 2026 at 11:04:49AM +0100, Francesco Lavra wrote:
...
> > > + snprintf(sensor->name, sizeof(sensor->name), "%s_sf", name);
> >
> > Does GCC complain on this (`make W=1` build)?
> > Since this can cut the string and we don't check the return value, the Q
> > is:
> > is this okay to have a reduced string?
>
> gcc does not complain with W=1. sensor->name is appropriately sized to
> accommodate the longest possible name; if it wasn't, the string would be
> cut in the accel and gyro IIO devices too (which use a longer suffix than
> "_sf").
Right, the question is if compiler can prove that or not.
We have several patches in input subsystem to hide the warning by switching
to scnprintf(), which I consider not the best approach, but still it depends
if we care about cut or not. If we do, we should check for overflow.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-01-20 9:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-19 10:04 [PATCH v3 0/3] imu: st_lsm6dsx: Add support for rotation sensor Francesco Lavra
2026-01-19 10:04 ` [PATCH v3 1/3] iio: imu: st_lsm6dsx: set FIFO ODR for accelerometer and gyroscope only Francesco Lavra
2026-01-19 10:04 ` [PATCH v3 2/3] iio: imu: st_lsm6dsx: set buffer sampling frequency for accelerometer only Francesco Lavra
2026-01-19 10:04 ` [PATCH v3 3/3] iio: imu: st_lsm6dsx: add support for rotation sensor Francesco Lavra
2026-01-19 10:33 ` Andy Shevchenko
2026-01-20 9:28 ` Francesco Lavra
2026-01-20 9:36 ` Andy Shevchenko [this message]
2026-01-20 10:03 ` Francesco Lavra
2026-01-20 10:25 ` Andy Shevchenko
2026-01-20 12:23 ` Francesco Lavra
2026-01-20 12:29 ` Andy Shevchenko
2026-01-20 6:46 ` Dan Carpenter
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=aW9MhYO_xhlQXFn2@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=flavra@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=nuno.sa@analog.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox