From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Gustavo Silva <gustavograzs@gmail.com>
Cc: "Alex Lanzano" <lanzano.alex@gmail.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] iio: imu: bmi270: add channel for step counter
Date: Fri, 6 Jun 2025 12:14:44 +0300 [thread overview]
Message-ID: <aEKxhPFDQEIN1xnm@smile.fi.intel.com> (raw)
In-Reply-To: <20250605-bmi270-events-v2-1-8b2c07d0c213@gmail.com>
On Thu, Jun 05, 2025 at 07:05:01PM -0300, Gustavo Silva wrote:
> Add a channel for enabling/disabling the step counter, reading the
> number of steps and resetting the counter.
...
> +static int bmi270_update_feature_reg(struct bmi270_data *data,
> + enum bmi270_feature_reg_id id,
> + u16 mask, u16 val)
> +{
> + u16 regval = 0;
Redundant assignment.
> + int ret;
> +
> + ret = bmi270_read_feature_reg(data, id, ®val);
> + if (ret)
> + return ret;
> + set_mask_bits(®val, mask, val);
You can't do this on the 16-bit values on some architectures.
Maybe it's easy to implement cmpxchg() for 16-bit values there,
though.
> + return bmi270_write_feature_reg(data, id, regval);
> +}
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-06-06 9:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-05 22:05 [PATCH v2 0/3] BMI270: Add support for step counter and motion events Gustavo Silva
2025-06-05 22:05 ` [PATCH v2 1/3] iio: imu: bmi270: add channel for step counter Gustavo Silva
2025-06-06 7:43 ` kernel test robot
2025-06-06 9:14 ` Andy Shevchenko [this message]
2025-06-07 15:50 ` Jonathan Cameron
2025-06-08 20:03 ` Andy Shevchenko
2025-06-05 22:05 ` [PATCH v2 2/3] iio: imu: bmi270: add step counter watermark event Gustavo Silva
2025-06-07 15:54 ` Jonathan Cameron
2025-06-05 22:05 ` [PATCH v2 3/3] iio: imu: bmi270: add support for motion events Gustavo Silva
2025-06-07 16:02 ` Jonathan Cameron
2025-06-17 7:28 ` Lothar Rubusch
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=aEKxhPFDQEIN1xnm@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=dlechner@baylibre.com \
--cc=gustavograzs@gmail.com \
--cc=jic23@kernel.org \
--cc=lanzano.alex@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®