All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: "Hon Ching (Vicky) Lo"
	<honclo-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] tpm: fix tpm_bios_log_setup stub prototype
Date: Wed, 16 Mar 2016 12:13:41 +0200	[thread overview]
Message-ID: <20160316101341.GA4051@intel.com> (raw)
In-Reply-To: <1458116410-3208536-1-git-send-email-arnd-r2nGTMty4D4@public.gmane.org>

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 <arnd-r2nGTMty4D4@public.gmane.org>
> 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

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140

WARNING: multiple messages have this Message-ID (diff)
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Peter Huewe <peterhuewe@gmx.de>,
	Marcel Selhorst <tpmdd@selhorst.net>,
	Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
	"Hon Ching (Vicky) Lo" <honclo@linux.vnet.ibm.com>,
	tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tpm: fix tpm_bios_log_setup stub prototype
Date: Wed, 16 Mar 2016 12:13:41 +0200	[thread overview]
Message-ID: <20160316101341.GA4051@intel.com> (raw)
In-Reply-To: <1458116410-3208536-1-git-send-email-arnd@arndb.de>

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 <arnd@arndb.de>
> 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

  parent reply	other threads:[~2016-03-16 10:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16  8:19 [PATCH] tpm: fix tpm_bios_log_setup stub prototype Arnd Bergmann
2016-03-16  8:19 ` Arnd Bergmann
     [not found] ` <1458116410-3208536-1-git-send-email-arnd-r2nGTMty4D4@public.gmane.org>
2016-03-16 10:13   ` Jarkko Sakkinen [this message]
2016-03-16 10:13     ` Jarkko Sakkinen
     [not found]     ` <20160316101341.GA4051-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-03-16 17:57       ` Jason Gunthorpe
2016-03-16 17:57         ` Jason Gunthorpe
     [not found]         ` <20160316175726.GB6127-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-03-16 19:18           ` Stefan Berger
2016-03-16 19:18             ` Stefan Berger

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=20160316101341.GA4051@intel.com \
    --to=jarkko.sakkinen-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=honclo-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.