tpm: Fix compilation warning when CONFIG_PNP is not defined
Subsystems (2)
PATCH 1/1 tpm: Fix compilation warning when CONFIG_PNP is not defined
The is_itpm() function is only accessed from a block surrounded by #ifdef CONFIG_PNP. Therefore, also surround it with #ifdef CONFIG_PNP and remove the #else branch causing the warning.
http://lxr.linux.no/#linux+v2.6.39/drivers/char/tpm/tpm_tis.c#L622
--- drivers/char/tpm/tpm_tis.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/char/tpm/tpm_tis.c +1 -6
@@ -80,7 +80,7 @@ enum tis_defaults {static LIST_HEAD (tis_chips);static DEFINE_SPINLOCK (tis_lock); -#ifdef CONFIG_ACPI +#ifdef CONFIG_PNPN static int is_itpm (struct pnp_dev *dev) {struct acpi_device *acpi =pnp_acpi_device (dev);
@@ -93,11 +93,6 @@ static int is_itpm(struct pnp_dev *dev) return 0; } -#else -static int is_itpm (struct pnp_dev *dev) -{ -return 0 ; -}#endif static int check_locality (struct tpm_chip *chip,int l)
Quoted 7 lines · On Sun, 17 Jul 2011 07:55:58 -0400 Stefan Berger wrote:
The
is_itpm()function is only accessed from a block surrounded by #ifdefCONFIG_PNP. Therefore, also surround it with #ifdefCONFIG_PNPand remove the #else branch causing the warning.http://lxr.linux.no/#linux+v2.6.39/drivers/char/tpm/tpm_tis.c#L622
Signed-off-by Stefan Berger <[email protected]>
Thanks.
Quoted 21 lines
--- drivers/char/tpm/tpm_tis.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)Index:
linux-2.6/drivers/char/tpm/tpm_tis.c
===================================================================drivers/char/tpm/tpm_tis.c +1
-1@@ -80,7 +80,7 @@ enum tis_defaults {static LIST_HEAD (tis_chips);static DEFINE_SPINLOCK (tis_lock); -#ifdef CONFIG_ACPI +#ifdef CONFIG_PNPN static int is_itpm (struct pnp_dev *dev) {struct acpi_device *acpi =pnp_acpi_device (dev);@@ -93,11 +93,6 @@ static int is_itpm(struct pnp_dev *dev)
drivers/char/tpm/tpm_tis.c static int is_itpm(struct pnp_dev *dev) · line 98
Quoted 10 lines
drivers/char/tpm/tpm_tis.c +0
-5return 0; } -#else -static int is_itpm (struct pnp_dev *dev) -{ -return 0 ; -}#endif static int check_locality (struct tpm_chip *chip,int l)
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Hi Stefan,
Quoted 3 lines · On Sun, 17 Jul 2011 07:55:58 -0400 Stefan Berger <[email protected]>…
The
is_itpm()function is only accessed from a block surrounded by #ifdefCONFIG_PNP. Therefore, also surround it with #ifdefCONFIG_PNP
^^^
drivers/char/tpm/tpm_tis.c enum tis_defaults { · line 83
Quoted 8 lines
drivers/char/tpm/tpm_tis.c +1
-1@@ -80,7 +80,7 @@ enum tis_defaults {static LIST_HEAD (tis_chips);static DEFINE_SPINLOCK (tis_lock); -#ifdef CONFIG_ACPI +#ifdef CONFIG_PNPN
^^^^
Is this a typo?
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Quoted 13 lines · Stephen Rothwell
Hi Stefan,
Quoted 2 lines · On Sun, 17 Jul 2011 07:55:58 -0400 Stefan Berger<[email protected]>…
The
is_itpm()function is only accessed from a block surrounded by #ifdefCONFIG_PNP. Therefore, also surround it with #ifdefCONFIG_PNP^^^Quoted 6 lines
drivers/char/tpm/tpm_tis.c +0
-0@@ -80,7 +80,7 @@ enum tis_defaults {static LIST_HEAD (tis_chips);static DEFINE_SPINLOCK (tis_lock);
Quoted 5 lines
drivers/char/tpm/tpm_tis.c enum tis_defaults { · line 83
Quoted 2 lines
drivers/char/tpm/tpm_tis.c +1
-1-#ifdef CONFIG_ACPI +#ifdef CONFIG_PNPN ^^^^Is this a typo?
Argh, yes.
Stefan
Quoted 6 lines · Stefan Berger
Quoted 5 lines
drivers/char/tpm/tpm_tis.c enum tis_defaults { · line 83
Quoted 2 lines
drivers/char/tpm/tpm_tis.c +1
-1-#ifdef CONFIG_ACPI +#ifdef CONFIG_PNPN ^^^^Is this a typo?
Argh, yes.
Do you have an updated version?
Signature · 2 lines
James Morris <[email protected]>