diff --git a/src/sentryPlugins/hbm_online_repair/hbm-ras-events.c b/src/sentryPlugins/hbm_online_repair/hbm-ras-events.c index 54ebb2775a361d12881bdadddf69a58aa8e278dc..b859afb301a81132a4e8cc9dbf5c89a557a6d657 100644 --- a/src/sentryPlugins/hbm_online_repair/hbm-ras-events.c +++ b/src/sentryPlugins/hbm_online_repair/hbm-ras-events.c @@ -25,6 +25,8 @@ #include "hbm-ras-handler.h" #include "logger.h" +#define SIG_LIST_LEN 4 + static int get_debugfs_dir(char *debugfs_dir, size_t len) { FILE *fp = fopen("/proc/mounts", "r"); @@ -265,9 +267,8 @@ static int read_ras_event_all_cpus(struct ras_events* ras, unsigned n_cpus) } sigemptyset(&mask); - int sig_list_len = 4; - int sig_list[sig_list_len] = {SIGINT, SIGTERM, SIGHUP, SIGQUIT}; - for (i = 0; i < sig_list_len; i++) { + int sig_list[SIG_LIST_LEN] = {SIGINT, SIGTERM, SIGHUP, SIGQUIT}; + for (i = 0; i < SIG_LIST_LEN; i++) { sigaddset(&mask, sig_list[i]); } if (sigprocmask(SIG_BLOCK, &mask, NULL) == -1) @@ -296,7 +297,7 @@ static int read_ras_event_all_cpus(struct ras_events* ras, unsigned n_cpus) continue; } - for (i = 0; i < sig_list_len; i++) { + for (i = 0; i < SIG_LIST_LEN; i++) { if (fdsiginfo.ssi_signo == sig_list[i]) { log(LOG_INFO, "Received signal=%d\n", fdsiginfo.ssi_signo); goto error; @@ -441,7 +442,7 @@ static int add_event_handler(struct ras_events *ras, struct tep_handle *pevent, int handle_ras_events(struct ras_events *ras) { - int rc, i; + int rc; unsigned cpus; struct tep_handle *pevent; diff --git a/src/sentryPlugins/hbm_online_repair/hbm_online_repair.c b/src/sentryPlugins/hbm_online_repair/hbm_online_repair.c index c8438355086d6b6b44fa3b993d5abf15710830f5..c6de01156281246be7b06e05126533a392adc2d3 100644 --- a/src/sentryPlugins/hbm_online_repair/hbm_online_repair.c +++ b/src/sentryPlugins/hbm_online_repair/hbm_online_repair.c @@ -78,7 +78,7 @@ int handle_driver(char* driver_name, bool load) snprintf(command, DRIVER_COMMAND_LEN, "%s %s 2>&1", load ? "modprobe" : "rmmod", driver_name); ret = execute_command(command); - log(ret < 0 ? LOG_ERROR : LOG_DEBUG, "%s %s %s\n", load ? "load" : "unload", driver_name, ret < 0 ? "failed" : "success"); + log((ret < 0 ? LOG_ERROR : LOG_DEBUG), "%s %s %s\n", load ? "load" : "unload", driver_name, ret < 0 ? "failed" : "success"); return ret; }