From 6d5eb2a9a93922fa5cfd1c767573964185fb9ba9 Mon Sep 17 00:00:00 2001 From: Alexander Amelkin Date: Tue, 28 Jul 2020 13:38:06 +0300 Subject: hpmfwupg: Clean up / refactor - Drop a useless `extern` definition - Remove static variable `errorCount` from header, move it to the c file where it is actually used if needed Related to ipmitool/ipmitool#220 Signed-off-by: Alexander Amelkin --- include/ipmitool/ipmi_hpmfwupg.h | 19 ------------------- lib/ipmi_hpmfwupg.c | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/include/ipmitool/ipmi_hpmfwupg.h b/include/ipmitool/ipmi_hpmfwupg.h index 07f597b..d9f78c6 100644 --- a/include/ipmitool/ipmi_hpmfwupg.h +++ b/include/ipmitool/ipmi_hpmfwupg.h @@ -72,23 +72,6 @@ int ipmi_hpmfwupg_main(struct ipmi_intf *, int, char **); #define HPMFWUPG_FW_MISMATCH 0x83 #define HPMFWUPG_ROLLBACK_DENIED 0x83 -/* - * This error code is used as a temporary PATCH to - * the latest Open ipmi driver. This PATCH - * will be removed once a new Open IPMI driver is released. - * (Buggy version = 39) - */ -#define ENABLE_OPENIPMI_V39_PATCH - -#ifdef ENABLE_OPENIPMI_V39_PATCH -# define RETRY_COUNT_MAX 3 -static int errorCount; -# define HPMFWUPG_IS_RETRYABLE(error) \ - ((((error==0x83)||(error==0x82)||(error==0x80)) && (errorCount++ #endif +/* + * This error code is used as a temporary PATCH to + * the latest Open ipmi driver. This PATCH + * will be removed once a new Open IPMI driver is released. + * (Buggy version = 39) + */ +#define ENABLE_OPENIPMI_V39_PATCH + +#ifdef ENABLE_OPENIPMI_V39_PATCH +# define RETRY_COUNT_MAX 3 +static int errorCount; +# define HPMFWUPG_IS_RETRYABLE(error) \ + ((((error==0x83)||(error==0x82)||(error==0x80)) && (errorCount++