From 361a935332489c635192b39204c7ec7af1667c8f Mon Sep 17 00:00:00 2001 From: Elyes HAOUAS Date: Wed, 18 Dec 2019 21:26:33 +0100 Subject: {drivers,southbridge}: Replace min() with MIN() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is to remove min/max() from . Change-Id: Ica03d9aec8a81f57709abcac655dfb0ebce3f8c6 Signed-off-by: Elyes HAOUAS Reviewed-on: https://review.coreboot.org/c/coreboot/+/37818 Reviewed-by: Kyösti Mälkki Reviewed-by: Patrick Georgi Tested-by: build bot (Jenkins) --- src/drivers/i2c/tpm/cr50.c | 6 +++--- src/drivers/i2c/tpm/tis_atmel.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/drivers/i2c/tpm') diff --git a/src/drivers/i2c/tpm/cr50.c b/src/drivers/i2c/tpm/cr50.c index 8ea544d0db..34873dc9e4 100644 --- a/src/drivers/i2c/tpm/cr50.c +++ b/src/drivers/i2c/tpm/cr50.c @@ -28,6 +28,7 @@ */ #include +#include #include #include #include @@ -36,7 +37,6 @@ #include #include #include -#include #include "tpm.h" @@ -341,7 +341,7 @@ static int cr50_i2c_tis_recv(struct tpm_chip *chip, uint8_t *buf, if (cr50_i2c_wait_burststs(chip, mask, &burstcnt, &status) < 0) goto out_err; - len = min(burstcnt, expected - current); + len = MIN(burstcnt, expected - current); if (cr50_i2c_read(chip, addr, buf + current, len) != 0) { printk(BIOS_ERR, "%s: Read failed\n", __func__); goto out_err; @@ -400,7 +400,7 @@ static int cr50_i2c_tis_send(struct tpm_chip *chip, uint8_t *buf, size_t len) /* Use burstcnt - 1 to account for the address byte * that is inserted by cr50_i2c_write() */ - limit = min(burstcnt - 1, len); + limit = MIN(burstcnt - 1, len); if (cr50_i2c_write(chip, TPM_DATA_FIFO(chip->vendor.locality), &buf[sent], limit) != 0) { printk(BIOS_ERR, "%s: Write failed\n", __func__); diff --git a/src/drivers/i2c/tpm/tis_atmel.c b/src/drivers/i2c/tpm/tis_atmel.c index 793418a96a..74b4830b6a 100644 --- a/src/drivers/i2c/tpm/tis_atmel.c +++ b/src/drivers/i2c/tpm/tis_atmel.c @@ -14,13 +14,13 @@ #include #include +#include #include #include #include #include #include #include -#include #include #include @@ -99,7 +99,7 @@ int tis_sendrecv(const uint8_t *sendbuf, size_t sbuf_size, return -1; /* Determine the number of bytes remaining */ - recv_bytes = min(be32_to_cpu(*(uint32_t *)&header->length), + recv_bytes = MIN(be32_to_cpu(*(uint32_t *)&header->length), max_recv_bytes); /* Determine if there is additional response data */ -- cgit v1.2.3