From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932414AbdJYS60 (ORCPT ); Wed, 25 Oct 2017 14:58:26 -0400 Received: from mga14.intel.com ([192.55.52.115]:23762 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932231AbdJYS6W (ORCPT ); Wed, 25 Oct 2017 14:58:22 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,432,1503385200"; d="scan'208";a="1235252534" Date: Wed, 25 Oct 2017 20:58:17 +0200 From: Jarkko Sakkinen To: PrasannaKumar Muralidharan Cc: Jason Gunthorpe , 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" Subject: Re: [PATCH] tpm: Move Linux RNG connection to hwrng Message-ID: <20171025185817.hoalqzud3646yuy7@linux.intel.com> References: <20171024184235.GC1806@obsidianresearch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. /Jarkko