Re: [PATCH v2 2/3] platform/x86/intel/tpmi: Add debugfs interface

From: Andy Shevchenko
Date: Thu Jul 13 2023 - 12:42:55 EST


On Wed, Jul 12, 2023 at 04:06:50PM -0700, srinivas pandruvada wrote:
> On Wed, 2023-07-12 at 18:13 +0300, Andy Shevchenko wrote:
> > On Tue, Jul 11, 2023 at 03:09:48PM -0700, Srinivas Pandruvada wrote:

...

> > >  struct intel_tpmi_pm_feature {
> > >         struct intel_tpmi_pfs_entry pfs_header;
> > >         unsigned int vsec_offset;
> > > +       struct intel_vsec_device *vsec_dev;
> >
> > Hmm... I don't know the layout of pfs_header, but this may be 4 bytes
> > less
> > if you move it upper.
> The pfs_header is packed with size of 64 bit. So size will not change.

So, it will be a gap of 4 bytes due to alignment, no?

> > >  };

...

> > > +       for (i = 0; i < tpmi_info->feature_count; ++i) {
> >
> > Why preincrement?
> Does it matter for a "for" loop increment?

Stylewise. Preincrement raises a flag to the reader "what the heck is special
here that we need preincrement". If not required, I would use postincrement.

--
With Best Regards,
Andy Shevchenko