* [PATCH] tpm: Move tpm_tis_reenable_interrupts out of CONFIG_PNP block
@ 2011-07-17 5:04 Stefan Berger
2011-07-17 5:34 ` Randy Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Berger @ 2011-07-17 5:04 UTC (permalink / raw)
To: sfr, Rajiv Andrade, James Morris; +Cc: linux-kernel@vger.kernel.org, linux-next
This patch moves the tpm_tis_reenable_interrupts function out of the
CONFIG_PNP-surrounded #define block. This solves a compilation error in
case CONFIG_PNP is not defined.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
---
drivers/char/tpm/tpm_tis.c | 45 +++++++++++++++++++++++----------------------
1 file changed, 23 insertions(+), 22 deletions(-)
Index: linux-2.6/drivers/char/tpm/tpm_tis.c
===================================================================
--- linux-2.6.orig/drivers/char/tpm/tpm_tis.c
+++ linux-2.6/drivers/char/tpm/tpm_tis.c
@@ -731,6 +731,29 @@ out_err:
tpm_remove_hardware(chip->dev);
return rc;
}
+
+static void tpm_tis_reenable_interrupts(struct tpm_chip *chip)
+{
+ u32 intmask;
+
+ /* reenable interrupts that device may have lost or
+ BIOS/firmware may have disabled */
+ iowrite8(chip->vendor.irq, chip->vendor.iobase +
+ TPM_INT_VECTOR(chip->vendor.locality));
+
+ intmask =
+ ioread32(chip->vendor.iobase +
+ TPM_INT_ENABLE(chip->vendor.locality));
+
+ intmask |= TPM_INTF_CMD_READY_INT
+ | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT
+ | TPM_INTF_STS_VALID_INT | TPM_GLOBAL_INT_ENABLE;
+
+ iowrite32(intmask,
+ chip->vendor.iobase + TPM_INT_ENABLE(chip->vendor.locality));
+}
+
+
#ifdef CONFIG_PNP
static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
const struct pnp_device_id *pnp_id)
@@ -757,28 +780,6 @@ static int tpm_tis_pnp_suspend(struct pn
return tpm_pm_suspend(&dev->dev, msg);
}
-static void tpm_tis_reenable_interrupts(struct tpm_chip *chip)
-{
- u32 intmask;
-
- /* reenable interrupts that device may have lost or
- BIOS/firmware may have disabled */
- iowrite8(chip->vendor.irq, chip->vendor.iobase +
- TPM_INT_VECTOR(chip->vendor.locality));
-
- intmask =
- ioread32(chip->vendor.iobase +
- TPM_INT_ENABLE(chip->vendor.locality));
-
- intmask |= TPM_INTF_CMD_READY_INT
- | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT
- | TPM_INTF_STS_VALID_INT | TPM_GLOBAL_INT_ENABLE;
-
- iowrite32(intmask,
- chip->vendor.iobase + TPM_INT_ENABLE(chip->vendor.locality));
-}
-
-
static int tpm_tis_pnp_resume(struct pnp_dev *dev)
{
struct tpm_chip *chip = pnp_get_drvdata(dev);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tpm: Move tpm_tis_reenable_interrupts out of CONFIG_PNP block
2011-07-17 5:04 [PATCH] tpm: Move tpm_tis_reenable_interrupts out of CONFIG_PNP block Stefan Berger
@ 2011-07-17 5:34 ` Randy Dunlap
2011-07-17 11:53 ` Harry Wei
0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2011-07-17 5:34 UTC (permalink / raw)
To: Stefan Berger
Cc: sfr, Rajiv Andrade, James Morris, linux-kernel@vger.kernel.org,
linux-next
On Sun, 17 Jul 2011 01:04:24 -0400 Stefan Berger wrote:
> This patch moves the tpm_tis_reenable_interrupts function out of the
> CONFIG_PNP-surrounded #define block. This solves a compilation error in
> case CONFIG_PNP is not defined.
>
> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
New warning:
drivers/char/tpm/tpm_tis.c:97: warning: 'is_itpm' defined but not used
Thanks.
>
> ---
> drivers/char/tpm/tpm_tis.c | 45 +++++++++++++++++++++++----------------------
> 1 file changed, 23 insertions(+), 22 deletions(-)
>
> Index: linux-2.6/drivers/char/tpm/tpm_tis.c
> ===================================================================
> --- linux-2.6.orig/drivers/char/tpm/tpm_tis.c
> +++ linux-2.6/drivers/char/tpm/tpm_tis.c
> @@ -731,6 +731,29 @@ out_err:
> tpm_remove_hardware(chip->dev);
> return rc;
> }
> +
> +static void tpm_tis_reenable_interrupts(struct tpm_chip *chip)
> +{
> + u32 intmask;
> +
> + /* reenable interrupts that device may have lost or
> + BIOS/firmware may have disabled */
> + iowrite8(chip->vendor.irq, chip->vendor.iobase +
> + TPM_INT_VECTOR(chip->vendor.locality));
> +
> + intmask =
> + ioread32(chip->vendor.iobase +
> + TPM_INT_ENABLE(chip->vendor.locality));
> +
> + intmask |= TPM_INTF_CMD_READY_INT
> + | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT
> + | TPM_INTF_STS_VALID_INT | TPM_GLOBAL_INT_ENABLE;
> +
> + iowrite32(intmask,
> + chip->vendor.iobase + TPM_INT_ENABLE(chip->vendor.locality));
> +}
> +
> +
> #ifdef CONFIG_PNP
> static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
> const struct pnp_device_id *pnp_id)
> @@ -757,28 +780,6 @@ static int tpm_tis_pnp_suspend(struct pn
> return tpm_pm_suspend(&dev->dev, msg);
> }
>
> -static void tpm_tis_reenable_interrupts(struct tpm_chip *chip)
> -{
> - u32 intmask;
> -
> - /* reenable interrupts that device may have lost or
> - BIOS/firmware may have disabled */
> - iowrite8(chip->vendor.irq, chip->vendor.iobase +
> - TPM_INT_VECTOR(chip->vendor.locality));
> -
> - intmask =
> - ioread32(chip->vendor.iobase +
> - TPM_INT_ENABLE(chip->vendor.locality));
> -
> - intmask |= TPM_INTF_CMD_READY_INT
> - | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT
> - | TPM_INTF_STS_VALID_INT | TPM_GLOBAL_INT_ENABLE;
> -
> - iowrite32(intmask,
> - chip->vendor.iobase + TPM_INT_ENABLE(chip->vendor.locality));
> -}
> -
> -
> static int tpm_tis_pnp_resume(struct pnp_dev *dev)
> {
> struct tpm_chip *chip = pnp_get_drvdata(dev);
>
> --
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tpm: Move tpm_tis_reenable_interrupts out of CONFIG_PNP block
2011-07-17 5:34 ` Randy Dunlap
@ 2011-07-17 11:53 ` Harry Wei
2011-07-17 12:14 ` Stefan Berger
0 siblings, 1 reply; 4+ messages in thread
From: Harry Wei @ 2011-07-17 11:53 UTC (permalink / raw)
To: Randy Dunlap
Cc: stefanb, sfr, srajiv, jmorris, linux-kernel, linux-next,
kongjianjun, harryxiyou
On Sat, Jul 16, 2011 at 10:34:26PM -0700, Randy Dunlap wrote:
> New warning:
> drivers/char/tpm/tpm_tis.c:97: warning: 'is_itpm' defined but not used
From: Harry Wei <harryxiyou@gmail.com>
This patch can fix above warning.
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Harry Wei <harryxiyou@gmail.com>
---
drivers/char/tpm/tpm_tis.c | 20 --------------------
1 files changed, 0 insertions(+), 20 deletions(-)
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index dd21df5..5929bb2 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -79,26 +79,6 @@ enum tis_defaults {
static LIST_HEAD(tis_chips);
static DEFINE_SPINLOCK(tis_lock);
-#ifdef CONFIG_ACPI
-static int is_itpm(struct pnp_dev *dev)
-{
- struct acpi_device *acpi = pnp_acpi_device(dev);
- struct acpi_hardware_id *id;
-
- list_for_each_entry(id, &acpi->pnp.ids, list) {
- if (!strcmp("INTC0102", id->id))
- return 1;
- }
-
- return 0;
-}
-#else
-static int is_itpm(struct pnp_dev *dev)
-{
- return 0;
-}
-#endif
-
static int check_locality(struct tpm_chip *chip, int l)
{
if ((ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] tpm: Move tpm_tis_reenable_interrupts out of CONFIG_PNP block
2011-07-17 11:53 ` Harry Wei
@ 2011-07-17 12:14 ` Stefan Berger
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Berger @ 2011-07-17 12:14 UTC (permalink / raw)
To: Randy Dunlap, sfr, srajiv, jmorris, linux-kernel, linux-next,
kongjianjun
On 07/17/2011 07:53 AM, Harry Wei wrote:
> On Sat, Jul 16, 2011 at 10:34:26PM -0700, Randy Dunlap wrote:
>> New warning:
>> drivers/char/tpm/tpm_tis.c:97: warning: 'is_itpm' defined but not used
> From: Harry Wei <harryxiyou@gmail.com>
>
> This patch can fix above warning.
>
> Reported-by: Randy Dunlap <rdunlap@xenotime.net>
> Signed-off-by: Harry Wei <harryxiyou@gmail.com>
> ---
> drivers/char/tpm/tpm_tis.c | 20 --------------------
> 1 files changed, 0 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
> index dd21df5..5929bb2 100644
> --- a/drivers/char/tpm/tpm_tis.c
> +++ b/drivers/char/tpm/tpm_tis.c
> @@ -79,26 +79,6 @@ enum tis_defaults {
> static LIST_HEAD(tis_chips);
> static DEFINE_SPINLOCK(tis_lock);
>
> -#ifdef CONFIG_ACPI
> -static int is_itpm(struct pnp_dev *dev)
> -{
> - struct acpi_device *acpi = pnp_acpi_device(dev);
> - struct acpi_hardware_id *id;
> -
> - list_for_each_entry(id, &acpi->pnp.ids, list) {
> - if (!strcmp("INTC0102", id->id))
> - return 1;
> - }
> -
> - return 0;
> -}
> -#else
> -static int is_itpm(struct pnp_dev *dev)
> -{
> - return 0;
> -}
> -#endif
> -
> static int check_locality(struct tpm_chip *chip, int l)
> {
> if ((ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &
It's not dead code. You'll get a compiler error once CONFIG_PNP is
enabled. NACK.
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-07-17 12:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-17 5:04 [PATCH] tpm: Move tpm_tis_reenable_interrupts out of CONFIG_PNP block Stefan Berger
2011-07-17 5:34 ` Randy Dunlap
2011-07-17 11:53 ` Harry Wei
2011-07-17 12:14 ` Stefan Berger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).