From: jgunthorpe@obsidianresearch.com (Jason Gunthorpe)
To: linux-security-module@vger.kernel.org
Subject: [PATCH] tpm: Move Linux RNG connection to hwrng
Date: Wed, 25 Oct 2017 13:37:07 -0600 [thread overview]
Message-ID: <20171025193707.GA998@obsidianresearch.com> (raw)
In-Reply-To: <20171025185817.hoalqzud3646yuy7@linux.intel.com>
On Wed, Oct 25, 2017 at 08:58:17PM +0200, Jarkko Sakkinen wrote:
> On Wed, Oct 25, 2017 at 08:15:09PM +0530, PrasannaKumar Muralidharan wrote:
> > > + if (!IS_ENABLED(CONFIG_HW_RANDOM_TPM))
> > > + return 0;
> >
> > Can #ifndef CONFIG_HW_RANDOM_TPM be used instead? That way an if
> > condition can be avoided.
>
> Nope. There is no reason to avoid the if-condition. Compiler will take
> care of it. IS_ENABLED() macro is available just for the purpose Jason
> is using it.
>
> > > + char tpm_hwrng_name[64];
> > > + struct hwrng tpm_hwrng;
> > > +
> >
> > Can this also be put inside the #ifdef?
>
> Yes. It should be inside #ifdef.
Then we need #idefs in the .c code, IS_ENABLED is not enough :\ I
don't think the few bytes matters enough to bother.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-10-25 19:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-24 18:42 [PATCH] tpm: Move Linux RNG connection to hwrng Jason Gunthorpe
2017-10-24 21:34 ` Jason Gunthorpe
2017-10-24 22:29 ` Jarkko Sakkinen
2017-10-25 14:45 ` PrasannaKumar Muralidharan
2017-10-25 15:18 ` Jason Gunthorpe
2017-10-25 15:25 ` PrasannaKumar Muralidharan
2017-10-25 18:58 ` Jarkko Sakkinen
2017-10-25 19:37 ` Jason Gunthorpe [this message]
2017-10-25 20:00 ` Jarkko Sakkinen
2017-10-25 20:04 ` Jason Gunthorpe
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=20171025193707.GA998@obsidianresearch.com \
--to=jgunthorpe@obsidianresearch.com \
--cc=linux-security-module@vger.kernel.org \
/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).