lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 04 Oct 2023 11:37:45 -0700
From:   srinivas pandruvada <srinivas.pandruvada@...ux.intel.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     hdegoede@...hat.com, markgross@...nel.org,
        ilpo.jarvinen@...ux.intel.com, platform-driver-x86@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/3] platform/x86/intel/tpmi: Add defines to get
 version information

On Wed, 2023-10-04 at 15:59 +0300, 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)

OK. Will add another patch on top.

Thanks,
Srinivas

> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ