From: Mehdi Djait <mehdi.djait.k@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: kernel test robot <lkp@intel.com>,
jic23@kernel.org, mazziesaccount@gmail.com,
oe-kbuild-all@lists.linux.dev, krzysztof.kozlowski+dt@linaro.org,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v2 5/5] iio: accel: Add support for Kionix/ROHM KX132-1211 accelerometer
Date: Sun, 23 Apr 2023 22:56:57 +0200 [thread overview]
Message-ID: <ZEWbmSuJqWJWf0aD@carbian> (raw)
In-Reply-To: <ZEQGqFLIyxm5XENQ@smile.fi.intel.com>
Hello Andy,
thank you for the review.
On Sat, Apr 22, 2023 at 07:09:12PM +0300, Andy Shevchenko wrote:
> On Sat, Apr 22, 2023 at 07:19:44AM +0800, kernel test robot wrote:
> > Hi Mehdi,
> >
> > kernel test robot noticed the following build warnings:
>
> I believe it's not just a warning, it's a full functional error in the code.
>
> > 686 {
> > 687 struct device *dev = regmap_get_device(data->regmap);
> > 688 __le16 buf_status;
> > 689 int ret, fifo_bytes;
> > 690
> > 691 ret = regmap_bulk_read(data->regmap, data->chip_info->buf_status1,
> > 692 &buf_status, sizeof(buf_status));
> > 693 if (ret) {
> > 694 dev_err(dev, "Error reading buffer status\n");
> > 695 return ret;
> > 696 }
> > 697
> > > 698 buf_status &= data->chip_info->buf_smp_lvl_mask;
> > 699 fifo_bytes = le16_to_cpu(buf_status);
>
> You need to mask in the same endianess space, i.o.w. either on CPU or device side.
>
> I believe you wanted to have fifo_bytes to be masked, but I'm not sure.
I wanted to read the registers buf_status_1 and buf_status_2 --> 16 bits
and mask the result of the read to get the bits 0..9 which is the
buf_status: the number of bytes in the buffer
This is due to my lack of experience, but I have a question:
If I don't get any warnings when testing, how should I go about this ? I
will obviously fix this, but this is for the future.
--
Kind Regards
Mehdi Djait
next prev parent reply other threads:[~2023-04-23 20:57 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-20 20:22 [PATCH v2 0/5] iio: accel: Add support for Kionix/ROHM KX132-1211 accelerometer Mehdi Djait
2023-04-20 20:22 ` [PATCH v2 1/5] dt-bindings: iio: Add " Mehdi Djait
2023-04-21 3:36 ` Matti Vaittinen
2023-04-21 8:12 ` Krzysztof Kozlowski
2023-04-20 20:22 ` [PATCH v2 2/5] iio: accel: kionix-kx022a: Warn on failed matches and assume compatibility Mehdi Djait
2023-04-21 3:44 ` Matti Vaittinen
2023-04-22 17:26 ` Jonathan Cameron
2023-04-22 17:28 ` Jonathan Cameron
2023-04-23 20:59 ` Mehdi Djait
2023-04-20 20:22 ` [PATCH v2 3/5] iio: accel: kionix-kx022a: Refactor driver and add chip_info structure Mehdi Djait
2023-04-21 6:19 ` Matti Vaittinen
2023-04-22 17:32 ` Jonathan Cameron
2023-04-23 21:01 ` Mehdi Djait
2023-04-20 20:22 ` [PATCH v2 4/5] iio: accel: kionix-kx022a: Add a function to retrieve number of bytes in buffer Mehdi Djait
2023-04-21 6:14 ` Matti Vaittinen
2023-04-22 17:36 ` Jonathan Cameron
2023-04-22 17:42 ` Jonathan Cameron
2023-04-23 22:06 ` Mehdi Djait
2023-04-22 17:46 ` Jonathan Cameron
2023-04-23 22:05 ` Mehdi Djait
2023-04-20 20:22 ` [PATCH v2 5/5] iio: accel: Add support for Kionix/ROHM KX132-1211 accelerometer Mehdi Djait
2023-04-21 23:19 ` kernel test robot
2023-04-22 16:09 ` Andy Shevchenko
2023-04-23 20:56 ` Mehdi Djait [this message]
2023-04-24 14:56 ` Mehdi Djait
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=ZEWbmSuJqWJWf0aD@carbian \
--to=mehdi.djait.k@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mazziesaccount@gmail.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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.