From: PrasannaKumar Muralidharan Subject: Re: [PATCH] tpm: Move Linux RNG connection to hwrng Date: Wed, 25 Oct 2017 20:55:33 +0530 Message-ID: References: <20171024184235.GC1806@obsidianresearch.com> <20171025151859.GB15557@obsidianresearch.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Jarkko Sakkinen , Stefan Berger , linux-integrity@vger.kernel.org, David Howells , Herbert Xu , Dmitry Kasatkin , open list , linux-security-module@vger.kernel.org, "open list:KEYS-TRUSTED" , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , James Morris , Matt Mackall , David Safford , Mimi Zohar , "Serge E. Hallyn" To: Jason Gunthorpe Return-path: In-Reply-To: <20171025151859.GB15557@obsidianresearch.com> Sender: owner-linux-security-module@vger.kernel.org List-Id: linux-crypto.vger.kernel.org Hi Jason, On 25 October 2017 at 20:48, Jason Gunthorpe wrote: > On Wed, Oct 25, 2017 at 08:15:09PM +0530, PrasannaKumar Muralidharan > wrote: > >> > +static int tpm_add_hwrng(struct tpm_chip *chip) >> > +{ >> > + 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. > > Generally speaking IS_ENABLED is prefered over #ifdef as it reduces the > set of compilation combinations. Oh okay. No issues then. Regards, PrasannaKumar