From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Hans de Goede <hdegoede@redhat.com>,
markgross@kernel.org, platform-driver-x86@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/3] platform/x86/intel/tpmi: Add defines to get version information
Date: Wed, 4 Oct 2023 16:03:31 +0300 (EEST) [thread overview]
Message-ID: <a55042c8-bd-d035-4f9e-83f6e2f6038@linux.intel.com> (raw)
In-Reply-To: <ZR1hzZ4KNZqElGGH@smile.fi.intel.com>
On Wed, 4 Oct 2023, Andy Shevchenko wrote:
> On Tue, Oct 03, 2023 at 11:49:14AM -0700, Srinivas Pandruvada wrote:
> > Add defines to get major and minor version from a TPMI version field
> > value. This will avoid code duplication to convert in every feature
> > driver. Also add define for invalid version field.
>
> ...
>
> > +#define TPMI_VERSION_INVALID 0xff
>
> I would make it clearer with (GENMASK(7, 5) | GENMASK(4, 0))
> or even with specific masks defined and used in both cases:
> #def
>
> #define TPMI_MINVER_MASK GENMASK(4, 0)
> #define TPMI_MAJVER_MASK GENMASK(7, 5)
>
> #define TPMI_VERSION_INVALID (TPMI_MINVER_MASK | TPMI_MAJVER_MASK)
>
> #define TPMI_MINOR_VERSION(val) FIELD_GET(TPMI_MINVER_MASK, val)
> #define TPMI_MAJOR_VERSION(val) FIELD_GET(TPMI_MAJVER_MASK, val)
>
> > +#define TPMI_MINOR_VERSION(val) FIELD_GET(GENMASK(4, 0), val)
> > +#define TPMI_MAJOR_VERSION(val) FIELD_GET(GENMASK(7, 5), val)
In case somebody does, please do it on top of the existing changes as
I already applied the series.
--
i.
next prev parent reply other threads:[~2023-10-04 13:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-03 18:49 [PATCH v2 0/3] TPMI feature major/minor version check Srinivas Pandruvada
2023-10-03 18:49 ` [PATCH v2 1/3] platform/x86/intel/tpmi: Add defines to get version information Srinivas Pandruvada
2023-10-04 12:59 ` Andy Shevchenko
2023-10-04 13:03 ` Ilpo Järvinen [this message]
2023-10-04 18:37 ` srinivas pandruvada
2023-10-03 18:49 ` [PATCH v2 2/3] platform/x86: ISST: Ignore minor version change Srinivas Pandruvada
2023-10-03 18:49 ` [PATCH v2 3/3] platform/x86/intel-uncore-freq: " Srinivas Pandruvada
2023-10-04 9:08 ` [PATCH v2 0/3] TPMI feature major/minor version check Ilpo Järvinen
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=a55042c8-bd-d035-4f9e-83f6e2f6038@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markgross@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=srinivas.pandruvada@linux.intel.com \
/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