Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1358681 > unrolled thread

[PATCH] tpm: fix tpm_bios_log_setup stub prototype

Started byArnd Bergmann <arnd@arndb.de>
First post2016-03-16 09:30 +0100
Last post2016-03-16 20:20 +0100
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] tpm: fix tpm_bios_log_setup stub prototype Arnd Bergmann <arnd@arndb.de> - 2016-03-16 09:30 +0100
    Re: [PATCH] tpm: fix tpm_bios_log_setup stub prototype Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-03-16 11:20 +0100
      Re: [PATCH] tpm: fix tpm_bios_log_setup stub prototype Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-03-16 19:00 +0100
        Re: [PATCH] tpm: fix tpm_bios_log_setup stub prototype Stefan Berger <stefanb@linux.vnet.ibm.com> - 2016-03-16 20:20 +0100

#1358681 — [PATCH] tpm: fix tpm_bios_log_setup stub prototype

FromArnd Bergmann <arnd@arndb.de>
Date2016-03-16 09:30 +0100
Subject[PATCH] tpm: fix tpm_bios_log_setup stub prototype
Message-ID<rdf07-6ju-51@gated-at.bofh.it>
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.

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

[toc] | [next] | [standalone]


#1358799

FromJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Date2016-03-16 11:20 +0100
Message-ID<rdgIy-7B0-25@gated-at.bofh.it>
In reply to#1358681
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

[toc] | [prev] | [next] | [standalone]


#1359205

FromJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Date2016-03-16 19:00 +0100
Message-ID<rdnTI-3JO-13@gated-at.bofh.it>
In reply to#1358799
On Wed, Mar 16, 2016 at 12:13:41PM +0200, Jarkko Sakkinen wrote:
> 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.

The weird thing is I already applied this hunk to the patch, an
autobuilder found it, it is right in my personal tree..

Unclear where it got dropped? Are we missing anything else in that
series? Stephen?

Jason

[toc] | [prev] | [next] | [standalone]


#1359237

FromStefan Berger <stefanb@linux.vnet.ibm.com>
Date2016-03-16 20:20 +0100
Message-ID<rdp97-4Jh-1@gated-at.bofh.it>
In reply to#1359205
On 03/16/2016 01:57 PM, Jason Gunthorpe wrote:
> On Wed, Mar 16, 2016 at 12:13:41PM +0200, Jarkko Sakkinen wrote:
>> 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.
> The weird thing is I already applied this hunk to the patch, an
> autobuilder found it, it is right in my personal tree..
>
> Unclear where it got dropped? Are we missing anything else in that
> series? Stephen?

If I lost it, I certainly did not drop it intentionately.

    Stefan

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web