All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Angel Iglesias <ang.iglesiasg@gmail.com>
Cc: linux-iio <linux-iio@vger.kernel.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Paul Cercueil <paul@crapouillou.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 1/5] iio: pressure: bmp280: simplify driver initialization logic
Date: Mon, 8 Aug 2022 10:18:57 +0200	[thread overview]
Message-ID: <CAHp75VezCZFSzBfMw92uRpirU32Ac685v-P1=JakofrhNgoN=g@mail.gmail.com> (raw)
In-Reply-To: <602f032955b56eb367177d1de7536f18ad94bc87.1659872590.git.ang.iglesiasg@gmail.com>

On Sun, Aug 7, 2022 at 1:55 PM Angel Iglesias <ang.iglesiasg@gmail.com> wrote:
>
> Simplified common initialization logic of different sensor types
> unifying calibration and initial configuration recovery.
>
> Default config param values of each sensor type are stored inside
> chip_info structure and used to initialize sensor data struct instance.
>
> The helper functions for read each sensor type calibration are converted
> to a callback available on the chip_info struct.
>
> Revised BMP180 and BMP280 definitions and code functions to use GENMASK
> and FIELD_PREP/FIELD_GET utilities to homogenize structure with more
> recent drivers, in preparation for the patches adding support for the
> BMP380 sensors.

...

>         int ret;
>         unsigned int tmp;
>         __le16 l16;
>         __be16 b16;
>         struct device *dev = data->dev;
> +       struct bmp280_calib *calib = &data->calib.bmp280;

When you add longer lines, try to put them to be first.

>         __le16 t_buf[BMP280_COMP_TEMP_REG_COUNT / 2];
>         __le16 p_buf[BMP280_COMP_PRESS_REG_COUNT / 2];

...

>         int ret;
> -       u8 osrs = BMP280_OSRS_TEMP_X(data->oversampling_temp + 1) |
> -                 BMP280_OSRS_PRESS_X(data->oversampling_press + 1);
> +       u8 osrs = FIELD_PREP(BMP280_OSRS_TEMP_MASK, data->oversampling_temp + 1) |
> +                 FIELD_PREP(BMP280_OSRS_PRESS_MASK, data->oversampling_press + 1);

Ditto, move it to be before `int ret;` at the same time. Same for
other similar cases.

...

> +       /* apply initial values from chip info structure */

Make (one-line) comments consistent...

>         /* Bring up regulators */

...see the difference?

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2022-08-08  8:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-07 11:52 [PATCH v5 0/5] Add support for pressure sensor Bosch BMP380 Angel Iglesias
2022-08-07 11:54 ` [PATCH v5 1/5] iio: pressure: bmp280: simplify driver initialization logic Angel Iglesias
2022-08-08  8:18   ` Andy Shevchenko [this message]
2022-08-14 13:43   ` Jonathan Cameron
2022-08-14 14:26     ` Angel Iglesias
2022-08-07 11:55 ` [PATCH v5 2/5] iio: pressure: bmp280: Fix alignment for DMA safety Angel Iglesias
2022-08-08  8:53   ` Andy Shevchenko
2022-08-12  9:59     ` Angel Iglesias
2022-08-14 13:52       ` Jonathan Cameron
2022-08-14 14:03   ` Jonathan Cameron
2022-08-07 11:55 ` [PATCH v5 3/5] iio: pressure: bmp280: Add support for BMP380 sensor family Angel Iglesias
2022-08-08  9:08   ` Andy Shevchenko
2022-08-12 10:47     ` Angel Iglesias
2022-08-14 14:11       ` Jonathan Cameron
2022-08-14 14:15   ` Jonathan Cameron
2022-08-14 14:37     ` Angel Iglesias
2022-08-14 16:56       ` Jonathan Cameron
2022-08-07 11:56 ` [PATCH v5 4/5] dt-bindings: iio: pressure: bmp085: Add BMP380 compatible string Angel Iglesias
2022-08-07 11:57 ` [PATCH v5 5/5] iio: pressure: bmp280: Add more tunable config parameters for BMP380 Angel Iglesias
2022-08-08  9:13   ` Andy Shevchenko
2022-09-12  0:53     ` Angel Iglesias
2022-09-15 13:33       ` Jonathan Cameron

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='CAHp75VezCZFSzBfMw92uRpirU32Ac685v-P1=JakofrhNgoN=g@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=ang.iglesiasg@gmail.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul@crapouillou.net \
    --cc=rafael.j.wysocki@intel.com \
    --cc=ulf.hansson@linaro.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 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.