From: Louis Adamian <adamianlouis@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] iio: pressure: ms5637: Add variant specific temperature compensation
Date: Fri, 7 Aug 2026 14:32:20 -0400 [thread overview]
Message-ID: <20260807143220.409fe4ec@louisarchdesktop> (raw)
In-Reply-To: <anT8Qs1ga7ayvtWZ@ashevche-desk.local>
On Fri, 7 Aug 2026 00:27:30 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> On Wed, Aug 05, 2026 at 01:06:51PM -0400, Louis Adamian wrote:
> > On Thu, 11 Jun 2026 22:32:02 +0300
> > Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> > > On Thu, Jun 11, 2026 at 03:10:26PM -0400, Louis Adamian wrote:
> > > > On Wed, 10 Jun 2026 21:37:58 +0300
> > > > Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> > > > > On Tue, Jun 09, 2026 at 10:04:58PM -0400, Louis Adamian
> > > > > wrote:
>
> ...
>
> > > > > > struct ms_tp_dev {
> > > > > > struct i2c_client *client;
> > > > >
> [...]
> > > > >
> > > > > Please, check with `pahole` if this is the best layout.
> > > >
> > > > I will correct the packing on this per pahole's finding.
> [...]
> > > > >
> > > > > Can this be simply embedded into ms_tp_dev (and copied there
> > > > > if required)?
> > > >
> > > > Copying in ms_tp_comp_consts provides no benefit over
> > > > referencing the pointer; the values are per-descriptor, not
> > > > per-instance and never modified. I'll keep the pointer (same as
> > > > ms_tp_hw_data).
> > >
> > > Okay, let me ask differently then: Can we use the same data type
> > > in ms_tp_dev instead of adding basically the same fields as in
> > > ms_tp_data?
> > >
> > Sorry for the very slow reply. Yes, for v3 ms_tp_dev will hold a
> > single const ms_tp_data *data instead of its own hw and
> > comp_consts. This drops the duplicated hw that predates this
> > series.
> >
> > One thing worth noting before I do that: ms_tp_data is currently
> > private to ms5637.c and will need to be moved to ms_sensors_i2c.h
> > for ms_tp_dev to point to it. I don't think this is a problem; it
> > matches how ms_tp_hw_data is defined now, but let me know if you
> > would like to avoid it.
>
> The pointer may be opaque, in that case it's not needed to be exposed.
>
ms_sensors_i2c.c dereferences both ->hw->prom_len in
ms_sensors_tp_read_prom and ->comp_consts in
ms_sensors_read_temp_and_pressure, so an opaque ms_tp_data would require
passing both pointers as parameters. I plan on moving ms_tp_data into
ms_sensors_i2c.h, dropping the original duplicate hw, unless you prefer
otherwise.
--
Thanks,
Louis
WARNING: multiple messages have this Message-ID (diff)
From: Louis Adamian <adamianlouis@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] iio: pressure: ms5637: Add variant specific temperature compensation
Date: Fri, 7 Aug 2026 14:33:01 -0400 [thread overview]
Message-ID: <20260807143220.409fe4ec@louisarchdesktop> (raw)
Message-ID: <20260807183301.jojTkoO7qAdG4ooOhaI6oqPjKBj8ters_AwSWjZQZt4@z> (raw)
In-Reply-To: <anT8Qs1ga7ayvtWZ@ashevche-desk.local>
On Fri, 7 Aug 2026 00:27:30 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> On Wed, Aug 05, 2026 at 01:06:51PM -0400, Louis Adamian wrote:
> > On Thu, 11 Jun 2026 22:32:02 +0300
> > Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> > > On Thu, Jun 11, 2026 at 03:10:26PM -0400, Louis Adamian wrote:
> > > > On Wed, 10 Jun 2026 21:37:58 +0300
> > > > Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> > > > > On Tue, Jun 09, 2026 at 10:04:58PM -0400, Louis Adamian
> > > > > wrote:
>
> ...
>
> > > > > > struct ms_tp_dev {
> > > > > > struct i2c_client *client;
> > > > >
> [...]
> > > > >
> > > > > Please, check with `pahole` if this is the best layout.
> > > >
> > > > I will correct the packing on this per pahole's finding.
> [...]
> > > > >
> > > > > Can this be simply embedded into ms_tp_dev (and copied there
> > > > > if required)?
> > > >
> > > > Copying in ms_tp_comp_consts provides no benefit over
> > > > referencing the pointer; the values are per-descriptor, not
> > > > per-instance and never modified. I'll keep the pointer (same as
> > > > ms_tp_hw_data).
> > >
> > > Okay, let me ask differently then: Can we use the same data type
> > > in ms_tp_dev instead of adding basically the same fields as in
> > > ms_tp_data?
> > >
> > Sorry for the very slow reply. Yes, for v3 ms_tp_dev will hold a
> > single const ms_tp_data *data instead of its own hw and
> > comp_consts. This drops the duplicated hw that predates this
> > series.
> >
> > One thing worth noting before I do that: ms_tp_data is currently
> > private to ms5637.c and will need to be moved to ms_sensors_i2c.h
> > for ms_tp_dev to point to it. I don't think this is a problem; it
> > matches how ms_tp_hw_data is defined now, but let me know if you
> > would like to avoid it.
>
> The pointer may be opaque, in that case it's not needed to be exposed.
>
ms_sensors_i2c.c dereferences both ->hw->prom_len in
ms_sensors_tp_read_prom and ->comp_consts in
ms_sensors_read_temp_and_pressure, so an opaque ms_tp_data would require
passing both pointers as parameters. I plan on moving ms_tp_data into
ms_sensors_i2c.h, dropping the original duplicate hw, unless you prefer
otherwise.
--
Thanks,
Louis
next prev parent reply other threads:[~2026-08-07 18:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-10 2:04 [PATCH v2 0/2] iio: pressure: ms5637: Add variant specific Louis Adamian
2026-06-10 2:04 ` [PATCH v2 1/2] dt-bindings: iio: pressure: Add MS5637 Louis Adamian
2026-06-10 2:15 ` sashiko-bot
2026-06-10 16:45 ` Conor Dooley
2026-06-11 14:48 ` Louis Adamian
2026-06-10 2:04 ` [PATCH v2 2/2] iio: pressure: ms5637: Add variant specific temperature compensation Louis Adamian
2026-06-10 2:14 ` sashiko-bot
2026-06-10 18:37 ` Andy Shevchenko
2026-06-11 16:50 ` Jonathan Cameron
2026-06-11 19:10 ` Louis Adamian
2026-06-11 19:32 ` Andy Shevchenko
2026-08-05 17:06 ` Louis Adamian
2026-08-06 21:27 ` Andy Shevchenko
2026-08-07 18:32 ` Louis Adamian [this message]
2026-08-07 18:33 ` Louis Adamian
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=20260807143220.409fe4ec@louisarchdesktop \
--to=adamianlouis@gmail.com \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=robh@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 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.