From b2176a9ce6b397fd39d320eb1ceb9ef9dae6895d Mon Sep 17 00:00:00 2001 From: Alexey Kardashevskiy Date: Wed, 27 Jan 2021 19:36:37 +1100 Subject: helpers: Define MIN() We already have MAX() defined, add MIN() to the common helpers header. Using the common helper also fixes a bug in tpmdrivers's MIN() where it was reverted. Reviewed-by: David Gibson Reviewed-by: Thomas Huth Signed-off-by: Alexey Kardashevskiy --- Changes: v2: * updated the comment about a fixed bug --- lib/libtpm/tcgbios.c | 2 -- lib/libtpm/tpm_drivers.c | 2 -- 2 files changed, 4 deletions(-) (limited to 'lib') diff --git a/lib/libtpm/tcgbios.c b/lib/libtpm/tcgbios.c index ee052e1..8e80811 100644 --- a/lib/libtpm/tcgbios.c +++ b/lib/libtpm/tcgbios.c @@ -43,8 +43,6 @@ #define dprintf(_x ...) #endif -#define MIN(a, b) ((a) < (b) ? (a) : (b)) - static struct { unsigned tpm_probed:1; unsigned tpm_found:1; diff --git a/lib/libtpm/tpm_drivers.c b/lib/libtpm/tpm_drivers.c index 5005176..0e13561 100644 --- a/lib/libtpm/tpm_drivers.c +++ b/lib/libtpm/tpm_drivers.c @@ -30,8 +30,6 @@ #define dprintf(_x ...) #endif -#define MIN(a, b) ((a) > (b) ? (b) : (a)) - /* layout of the command request queue for vTPM; all fields are big endian */ struct crq { uint8_t valid; -- cgit v1.1