Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966235AbcCPKNs (ORCPT ); Wed, 16 Mar 2016 06:13:48 -0400 Received: from mga09.intel.com ([134.134.136.24]:20652 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965836AbcCPKNq (ORCPT ); Wed, 16 Mar 2016 06:13:46 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,344,1455004800"; d="scan'208";a="670482491" Date: Wed, 16 Mar 2016 12:13:41 +0200 From: Jarkko Sakkinen To: Arnd Bergmann Cc: Peter Huewe , Marcel Selhorst , Jason Gunthorpe , "Hon Ching (Vicky) Lo" , tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tpm: fix tpm_bios_log_setup stub prototype Message-ID: <20160316101341.GA4051@intel.com> References: <1458116410-3208536-1-git-send-email-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458116410-3208536-1-git-send-email-arnd@arndb.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1669 Lines: 40 On Wed, Mar 16, 2016 at 09:19:48AM +0100, Arnd Bergmann wrote: > A cleanup patch changed the prototype of the regular tpm_bios_log_setup > function, but not that of the stub that is used when the TPM is disabled, > causing a harmless build warning: > > drivers/char/tpm/tpm-chip.c: In function 'tpm1_chip_register': > drivers/char/tpm/tpm-chip.c:287:38: error: passing argument 1 of 'tpm_bios_log_setup' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] > chip->bios_dir = tpm_bios_log_setup(dev_name(&chip->dev)); > In file included from ../drivers/char/tpm/tpm-chip.c:30:0: > ../drivers/char/tpm/tpm_eventlog.h:83:31: note: expected 'char *' but argument is of type 'const char *' > static inline struct dentry **tpm_bios_log_setup(char *name) > > This changes the stub function to match the normal prototype, > avoiding that warning. Good catch. Thank you. > Signed-off-by: Arnd Bergmann > Fixes: aca8db8088c3 ("tpm: Get rid of devname") > --- > drivers/char/tpm/tpm_eventlog.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/char/tpm/tpm_eventlog.h b/drivers/char/tpm/tpm_eventlog.h > index cc9672f64e8f..8de62b09be51 100644 > --- a/drivers/char/tpm/tpm_eventlog.h > +++ b/drivers/char/tpm/tpm_eventlog.h > @@ -80,7 +80,7 @@ int read_log(struct tpm_bios_log *log); > extern struct dentry **tpm_bios_log_setup(const char *); > extern void tpm_bios_log_teardown(struct dentry **); > #else > -static inline struct dentry **tpm_bios_log_setup(char *name) > +static inline struct dentry **tpm_bios_log_setup(const char *name) > { > return NULL; > } > -- > 2.7.0 /Jarkko