Skip to content

Commit

Permalink
char/tpm: Use true and false for bools
Browse files Browse the repository at this point in the history
Bool initializations should use true and false.  Bool tests don't need
comparisons.  Based on contributions from Joe Perches, Rusty Russell
and Bruce W Allan.

The semantic patch that makes this output is available
in scripts/coccinelle/misc/boolinit.cocci.

More information about semantic patching is available at
http://coccinelle.lip6.fr/

Signed-off-by: Peter Huewe <[email protected]>
Signed-off-by: Kent Yoder <[email protected]>
  • Loading branch information
PeterHuewe authored and Kent Yoder committed Feb 5, 2013
1 parent 348df8d commit 7324969
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/char/tpm/tpm_tis.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ static int probe_itpm(struct tpm_chip *chip)
if (vendor != TPM_VID_INTEL)
return 0;

itpm = 0;
itpm = false;

rc = tpm_tis_send_data(chip, cmd_getticks, len);
if (rc == 0)
Expand All @@ -383,7 +383,7 @@ static int probe_itpm(struct tpm_chip *chip)
tpm_tis_ready(chip);
release_locality(chip, chip->vendor.locality, 0);

itpm = 1;
itpm = true;

rc = tpm_tis_send_data(chip, cmd_getticks, len);
if (rc == 0) {
Expand Down Expand Up @@ -502,7 +502,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
return IRQ_HANDLED;
}

static bool interrupts = 1;
static bool interrupts = true;
module_param(interrupts, bool, 0444);
MODULE_PARM_DESC(interrupts, "Enable interrupts");

Expand Down Expand Up @@ -545,7 +545,7 @@ static int tpm_tis_init(struct device *dev, resource_size_t start,
rc = -ENODEV;
goto out_err;
}
itpm = (probe == 0) ? 0 : 1;
itpm = !!probe;
}

if (itpm)
Expand Down Expand Up @@ -741,10 +741,10 @@ static int tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
if (pnp_irq_valid(pnp_dev, 0))
irq = pnp_irq(pnp_dev, 0);
else
interrupts = 0;
interrupts = false;

if (is_itpm(pnp_dev))
itpm = 1;
itpm = true;

return tpm_tis_init(&pnp_dev->dev, start, len, irq);
}
Expand Down

0 comments on commit 7324969

Please sign in to comment.