From 52ab30b13b867c1f3cd5aa5d9eb3e24d430c49d5 Mon Sep 17 00:00:00 2001 From: Lee Leahy Date: Wed, 15 Mar 2017 09:22:11 -0700 Subject: drivers/i2c/tpm: Fix issues detected by checkpatch Fix the following warnings detected by checkpatch.pl: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' WARNING: braces {} are not necessary for single statement blocks WARNING: Unnecessary parentheses - maybe == should be = ? WARNING: line over 80 characters WARNING: missing space after return type TEST=Build and run on Galileo Gen2 Change-Id: I56f915f6c1975cce123fd38043bad2638717d88c Signed-off-by: Lee Leahy Reviewed-on: https://review.coreboot.org/18832 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/drivers/i2c/tpm/tpm.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/drivers/i2c/tpm/tpm.c') diff --git a/src/drivers/i2c/tpm/tpm.c b/src/drivers/i2c/tpm/tpm.c index 972b17de42..e804d6fc60 100644 --- a/src/drivers/i2c/tpm/tpm.c +++ b/src/drivers/i2c/tpm/tpm.c @@ -174,7 +174,8 @@ static int iic_tpm_write_generic(uint8_t addr, uint8_t *buffer, size_t len, int count; if (len > TPM_BUFSIZE) { - printk(BIOS_DEBUG, "%s: Length %zd is too large\n", __func__, len); + printk(BIOS_DEBUG, "%s: Length %zd is too large\n", + __func__, len); return -1; } @@ -313,7 +314,8 @@ static ssize_t get_burstcount(struct tpm_chip *chip) int timeout = 2 * 1000; /* 2s timeout */ while (timeout) { /* Note: STS is little endian */ - if (iic_tpm_read(TPM_STS(chip->vendor.locality) + 1, buf, 3) < 0) + if (iic_tpm_read(TPM_STS(chip->vendor.locality) + 1, buf, 3) + < 0) burstcnt = 0; else burstcnt = (buf[2] << 16) + (buf[1] << 8) + buf[0]; @@ -473,7 +475,7 @@ out_err: /* Initialization of I2C TPM */ -int tpm_vendor_probe(unsigned bus, uint32_t addr) +int tpm_vendor_probe(unsigned int bus, uint32_t addr) { struct tpm_inf_dev *tpm_dev = car_get_var_ptr(&g_tpm_dev); struct stopwatch sw; @@ -515,7 +517,7 @@ int tpm_vendor_probe(unsigned bus, uint32_t addr) return 0; } -int tpm_vendor_init(struct tpm_chip *chip, unsigned bus, uint32_t dev_addr) +int tpm_vendor_init(struct tpm_chip *chip, unsigned int bus, uint32_t dev_addr) { struct tpm_inf_dev *tpm_dev = car_get_var_ptr(&g_tpm_dev); uint32_t vendor; @@ -557,7 +559,8 @@ int tpm_vendor_init(struct tpm_chip *chip, unsigned bus, uint32_t dev_addr) } else if (be32_to_cpu(vendor) == TPM_TIS_I2C_DID_VID_9635) { tpm_dev->chip_type = SLB9635; } else { - printk(BIOS_DEBUG, "Vendor ID 0x%08x not recognized.\n", vendor); + printk(BIOS_DEBUG, "Vendor ID 0x%08x not recognized.\n", + vendor); goto out_err; } -- cgit v1.2.3