From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH v3 4/7] tpm: Redefine the read_log method to check for ACPI/OF properties sequentially Date: Tue, 30 Aug 2016 11:54:09 -0600 Message-ID: <20160830175409.GD6373@obsidianresearch.com> References: <1472532619-22170-1-git-send-email-nayna@linux.vnet.ibm.com> <1472532619-22170-5-git-send-email-nayna@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1472532619-22170-5-git-send-email-nayna-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Nayna Jain Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: tpmdd-devel@lists.sourceforge.net On Tue, Aug 30, 2016 at 12:50:16AM -0400, Nayna Jain wrote: > Currently, the difference in read_log method for ACPI/OF based platforms > is handled by defining respective read_log method and handing > them using CONFIG based #ifdef condition in Makefile which is not > the recommended approach. > > This patch cleans up the ifdef condition in Makefile by defining > single read_log method which checks for ACPI/OF event log memory in > sequence. > > Suggested-by: Jason Gunthorpe > Signed-off-by: Nayna Jain Reviewed-by: Jason Gunthorpe Yep, this is what I was looking to see.. > +#if defined(CONFIG_ACPI) > +int read_log_acpi(struct tpm_chip *chip); > +#else > +static inline int read_log_acpi(struct tpm_chip *chip) > +{ > + return -1; > +} > +#endif > + > +#if defined(CONFIG_OF) > +int read_log_of(struct tpm_chip *chip); > +#else > +static inline int read_log_of(struct tpm_chip *chip) > +{ > + return -1; > +} > +#endif Though shouldn't these two be ERRNOs of some kind? -ENODEV? Jason ------------------------------------------------------------------------------