Skip to contentSkip to conversation

tpm: fix tpm_bios_log_setup stub prototype

PATCH In review Arnd Bergmann 4 participants 4 messages Mar 16, 2016 TPM device driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm: fix tpm_bios_log_setup stub prototype

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.

Fixes aca8db8088c3 ("tpm: Get rid of devname")
---
 drivers/char/tpm/tpm_eventlog.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_eventlog.h +1 -1
index cc9672f64e8f..8de62b09be51 100644
@@ -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;
 }
Signature · 1 line
2.7.0
#1 lore raw
Quoted 11 lines · Arnd Bergmann

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)

Quoted 2 lines

This changes the stub function to match the normal prototype, avoiding that warning.

Good catch. Thank you.

Quoted 21 lines
Fixes aca8db8088c3 ("tpm: Get rid of devname")
---
 drivers/char/tpm/tpm_eventlog.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_eventlog.h +1 -1
index cc9672f64e8f..8de62b09be51 100644
@@ -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;
 }
Signature · 1 line
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

#2 lore raw
Quoted 12 lines · Jarkko Sakkinen
Quoted 11 lines · Arnd Bergmann

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)

Quoted 4 lines
Quoted 2 lines

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

------------------------------------------------------------------------------
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

#3 lore raw
Quoted 13 lines · Jason Gunthorpe
Quoted 12 lines · Jarkko Sakkinen
Quoted 11 lines · Arnd Bergmann

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)

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines

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

------------------------------------------------------------------------------
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