From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: "João Fernandes" <joaovictor.fernandes@usp.br>
Cc: jean-baptiste.maneyrol@tdk.com, jic23@kernel.org,
dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
Otavio Capobianco <gcotavio@usp.br>,
linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: imu: inv_icm42600: refactor sensors config
Date: Thu, 23 Apr 2026 11:09:36 +0300 [thread overview]
Message-ID: <aenTwHN57ltcqcP9@ashevche-desk.local> (raw)
In-Reply-To: <20260423020922.4057-1-joaovictor.fernandes@usp.br>
On Wed, Apr 22, 2026 at 11:09:20PM -0300, João Fernandes wrote:
> gyro and accel configs were refactored to reduce code duplication
Please, use proper English grammar and punctuation.
Also Submitting Patches documentation (which is assumed that you have
studied before sending patches) points out on imperative mood.
...
> - /* Sanitize missing values with current values */
> + /* choose context for old configuration */
One has to be consistent with the existing style in the driver. Or, if you
disagree, convert the driver to a style you prefer and provide _a very good_
justification why it should be done.
...
> + if (is_accel)
> + oldconf = &st->conf.accel;
> + else
> + oldconf = &st->conf.gyro;
Here and below the function is completely uglified. Even kernel documentation
suggests to avoid bool parameters like this.
If you need a common code, make it agnostic first (using parameters), and then
use small wrappers for each of the cases (accel, gyro).
...
> int inv_icm42600_set_gyro_conf(struct inv_icm42600_state *st,
> struct inv_icm42600_sensor_conf *conf,
> unsigned int *sleep_ms)
> {
> - struct inv_icm42600_sensor_conf *oldconf = &st->conf.gyro;
You see, this has to stay in the wrapper.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-04-23 8:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-23 2:09 [PATCH] iio: imu: inv_icm42600: refactor sensors config João Fernandes
2026-04-23 8:09 ` Andy Shevchenko [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=aenTwHN57ltcqcP9@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=gcotavio@usp.br \
--cc=jean-baptiste.maneyrol@tdk.com \
--cc=jic23@kernel.org \
--cc=joaovictor.fernandes@usp.br \
--cc=linux-iio@vger.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