Re: [PATCH v2 2/2] iio: pressure: ms5637: Add variant specific temperature compensation

From: Andy Shevchenko

Date: Thu Jun 11 2026 - 15:32:29 EST


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@xxxxxxxxx> wrote:
> > On Tue, Jun 09, 2026 at 10:04:58PM -0400, Louis Adamian wrote:

...

> > > struct ms_tp_dev {
> > > struct i2c_client *client;
> >
> > > const struct ms_tp_hw_data *hw;
> > > u16 prom[MS_SENSORS_TP_PROM_WORDS_NB];
> > > u8 res_index;
> > > + const struct ms_tp_comp_consts *comp_consts;
> >
> > Please, check with `pahole` if this is the best layout.
>
> I will correct the packing on this per pahole's finding.
> > > struct ms_tp_data {
> > > const char *name;
> > > const struct ms_tp_hw_data *hw;
> > > + const struct ms_tp_comp_consts *comp_consts;
> > > };
> >
> > 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?

--
With Best Regards,
Andy Shevchenko