tpmdd-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: Peter Huewe <peterhuewe@gmx.de>,
	Marcel Selhorst <tpmdd@selhorst.net>,
	"moderated list:TPM DEVICE DRIVER"
	<tpmdd-devel@lists.sourceforge.net>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tpm: fix invalid constant expressions in tpm.h
Date: Tue, 30 Aug 2016 09:31:03 +0300	[thread overview]
Message-ID: <20160830063103.GA4352@intel.com> (raw)
In-Reply-To: <20160830034536.GA29261@obsidianresearch.com>

On Mon, Aug 29, 2016 at 09:45:36PM -0600, Jason Gunthorpe wrote:
> On Tue, Aug 30, 2016 at 04:28:17AM +0300, Jarkko Sakkinen wrote:
> > The enums tpm_capabilities and tpm_sub_capabilities do not contain legit
> > constant expressions. This commit makes cap_id a separate parameter
> > in
> 
> I wonder if this is a bug in sparse? the macro uses gcc magic to
> expand to a constexpr.
> 
> You could also use __constant_cpu_to_be32 and similar instead.
> 
> But I admit I never liked the use of no-host endian in the constants..

It's too much magic for me, be it way or another :)


> >  #define TPM_ORD_STARTUP cpu_to_be32(153)
> >  #define TPM_ST_CLEAR cpu_to_be16(1)
> 
> Would be nice to see these fixed into an enum someday too

(putting note into my backlog text file)

> > +enum tpm1_capabilities {
> > +	TPM1_CAP_FLAG		= 0x04,
> > +	TPM1_CAP_PROP		= 0x05,
> > +	TPM1_CAP_VERSION_1_1	= 0x06,
> > +	TPM1_CAP_VERSION_1_2	= 0x1A,
> 
> I usually discourage the extra horizontal whitespace, just causes patch churn to
> keep it up (and clang-format won't do it automatically). Not sure if
> there is a consensus on that though.
> 
> But looks fine to me.
> 
> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>

Thanks!

> Jason

/Jarkko

      reply	other threads:[~2016-08-30  6:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-30  1:28 [PATCH] tpm: fix invalid constant expressions in tpm.h Jarkko Sakkinen
     [not found] ` <1472520498-24173-1-git-send-email-jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-08-30  3:45   ` Jason Gunthorpe
2016-08-30  6:31     ` Jarkko Sakkinen [this message]

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=20160830063103.GA4352@intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=tpmdd@selhorst.net \
    /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;
as well as URLs for NNTP newsgroup(s).