From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Gwendal Grignou <gwendal@chromium.org>
Cc: Benson Leung <bleung@chromium.org>,
Enric Balletbo i Serra <enric.balletbo@collabora.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
linux-iio <linux-iio@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v7 12/12] iio: cros_ec: flush as hwfifo attribute
Date: Sun, 29 Mar 2020 14:22:11 +0300 [thread overview]
Message-ID: <CAHp75VeRZO9DnTRZWavfp2FPjg_kqmpNr0VZnXv1U3G4Pr0iFQ@mail.gmail.com> (raw)
In-Reply-To: <20200327223443.6006-13-gwendal@chromium.org>
On Sat, Mar 28, 2020 at 12:37 AM Gwendal Grignou <gwendal@chromium.org> wrote:
>
> Add buffer/hwfifo_flush. It is not part of the ABI, but it follows ST
> and HID lead: Tells the sensor hub to send to the host all pending
> sensor events.
I see where discussion is going, but nevertheless some comments below
that you will not make same mistakes in the future.
...
> + int ret = 0;
Useless assignment.
> + bool flush;
> +
> + ret = strtobool(buf, &flush);
kstrtobool()
> + if (ret < 0)
Positive error codes? I'm not sure it returns a such. So ' < 0' part
is redundant.
> + return ret;
> + if (!flush)
> + return -EINVAL;
This I didn't get, you have accept only true as input? It's really strange.
> + ret = cros_ec_motion_send_host_cmd(st, 0);
> + if (ret != 0)
Similar to above ' != 0' part is redundant.
> + dev_warn(&indio_dev->dev, "Unable to flush sensor\n");
...
> +static IIO_DEVICE_ATTR(hwfifo_flush, 0644, NULL,
> + cros_ec_sensors_flush, 0);
IIO_DEVICE_ATTR_RW() ?
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2020-03-29 11:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-27 22:34 [PATCH v7 00/12] Cros EC sensor hub FIFO support Gwendal Grignou
2020-03-27 22:34 ` [PATCH v7 01/12] platform: chrome: sensorhub: Add the number of sensors in sensorhub Gwendal Grignou
2020-03-27 22:34 ` [PATCH v7 02/12] platform: chrome: sensorhub: Add FIFO support Gwendal Grignou
2020-03-27 22:34 ` [PATCH v7 03/12] platform: chrome: sensorhub: Add code to spread timestmap Gwendal Grignou
2020-03-27 22:34 ` [PATCH v7 04/12] platform: chrome: sensorhub: Add median filter Gwendal Grignou
2020-03-27 22:34 ` [PATCH v7 05/12] iio: cros_ec: Move function description to .c file Gwendal Grignou
2020-03-27 22:34 ` [PATCH v7 06/12] iio: expose iio_device_set_clock Gwendal Grignou
2020-03-27 22:34 ` [PATCH v7 07/12] iio: cros_ec: Register to cros_ec_sensorhub when EC supports FIFO Gwendal Grignou
2020-03-27 22:34 ` [PATCH v7 08/12] iio: cros_ec: Remove pm function Gwendal Grignou
2020-03-27 22:34 ` [PATCH v7 09/12] iio: cros_ec: Expose hwfifo_timeout Gwendal Grignou
2020-03-27 22:34 ` [PATCH v7 10/12] iio: cros_ec: Report hwfifo_watermark_max Gwendal Grignou
2020-03-27 22:34 ` [PATCH v7 11/12] iio: cros_ec: Use Hertz as unit for sampling frequency Gwendal Grignou
2020-03-27 22:34 ` [PATCH v7 12/12] iio: cros_ec: flush as hwfifo attribute Gwendal Grignou
2020-03-28 9:14 ` Enric Balletbo i Serra
2020-03-28 17:24 ` Jonathan Cameron
2020-03-28 17:22 ` Jonathan Cameron
2020-03-29 0:33 ` Gwendal Grignou
2020-03-29 9:31 ` Jonathan Cameron
2020-03-29 11:22 ` Andy Shevchenko [this message]
2020-03-30 12:56 ` [PATCH v7 00/12] Cros EC sensor hub FIFO support Enric Balletbo i Serra
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=CAHp75VeRZO9DnTRZWavfp2FPjg_kqmpNr0VZnXv1U3G4Pr0iFQ@mail.gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=bleung@chromium.org \
--cc=enric.balletbo@collabora.com \
--cc=gwendal@chromium.org \
--cc=linux-iio@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).