Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for few compilation warnings and checkpatch errors. #177

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion ras-arm-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ static void parse_arm_err_info(struct trace_seq *s, uint32_t type, uint64_t erro
restartable_pc = ((error_info >> ARM_ERR_RESTARTABLE_PC_SHIFT)
& ARM_ERR_RESTARTABLE_PC_MASK);
if (restartable_pc)
trace_seq_printf(s, " Program execution can be restarted reliably at the PC associated with the error");
trace_seq_printf(s, " Program execution can be restartable reliably at the PC");
}

/* The rest of the fields are specific to bus errors */
Expand Down
13 changes: 2 additions & 11 deletions ras-events.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ static void setup_event_trigger(char *event)
}
}

#ifdef HAVE_DISKERROR
#ifndef HAVE_BLK_RQ_ERROR
/*
* Set kernel filter. libtrace doesn't provide an API for setting filters
Expand Down Expand Up @@ -343,6 +344,7 @@ static int filter_ras_mc_event(struct ras_events *ras, char *group, char *event,
return 0;
}
#endif
#endif

/*
* Tracing read code
Expand Down Expand Up @@ -457,9 +459,6 @@ static int read_ras_event_all_cpus(struct pthread_data *pdata,
int warnonce[n_cpus];
char pipe_raw[PATH_MAX];
int legacy_kernel = 0;
#if 0
int need_sleep = 0;
#endif

memset(&warnonce, 0, sizeof(warnonce));

Expand Down Expand Up @@ -560,9 +559,6 @@ static int read_ras_event_all_cpus(struct pthread_data *pdata,
log(TERM, LOG_INFO,
"Error on CPU %i\n", i);
warnonce[i]++;
#if 0
need_sleep = 1;
#endif
}
}
if (!(fds[i].revents & POLLIN)) {
Expand Down Expand Up @@ -592,10 +588,6 @@ static int read_ras_event_all_cpus(struct pthread_data *pdata,
count_nready++;
}
}
#if 0
if (need_sleep)
sleep(POLLING_TIME);
#else
/*
* If we enable fallback mode, it will always be used, as
* poll is still not working fine, IMHO
Expand All @@ -605,7 +597,6 @@ static int read_ras_event_all_cpus(struct pthread_data *pdata,
legacy_kernel = 1;
break;
}
#endif
} while (1);

/* poll() is not supported. We need to fallback to the old way */
Expand Down
18 changes: 0 additions & 18 deletions ras-mce-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,28 +314,10 @@ static void report_mce_event(struct ras_events *ras,
if (*e->mc_location)
trace_seq_printf(s, ", %s", e->mc_location);

#if 0
/*
* While the logic for decoding tsc is there at mcelog, why to
* decode/print it, if we already got the uptime from the
* tracing event? Let's just discard it for now.
*/
trace_seq_printf(s, ", tsc= %d", e->tsc);
trace_seq_printf(s, ", walltime= %d", e->walltime);
#endif

trace_seq_printf(s, ", cpu_type= %s", cputype_name[mce->cputype]);
trace_seq_printf(s, ", cpu= %d", e->cpu);
trace_seq_printf(s, ", socketid= %d", e->socketid);

#if 0
/*
* The CPU vendor is already reported from mce->cputype
*/
trace_seq_printf(s, ", cpuvendor= %d", e->cpuvendor);
trace_seq_printf(s, ", cpuid= %d", e->cpuid);
#endif

if (e->ip)
trace_seq_printf(s, ", ip= %llx%s",
(long long)e->ip,
Expand Down
1 change: 1 addition & 0 deletions ras-memory-failure-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
*/

#define _GNU_SOURCE
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion ras-non-standard-handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct ras_ns_ev_decoder {
int (*decode)(struct ras_events *ras, struct ras_ns_ev_decoder *ev_decoder,
struct trace_seq *s, struct ras_non_standard_event *event);
#ifdef HAVE_SQLITE3
sqlite3_stmt *stmt_dec_record;
struct sqlite3_stmt *stmt_dec_record;
#endif
};

Expand Down
1 change: 0 additions & 1 deletion rbtree.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ static inline void rb_set_color(struct rb_node *rb, int color)
rb->rb_parent_color = (rb->rb_parent_color & ~1) | color;
}

#define RB_ROOT (struct rb_root) { NULL, }
#define rb_entry(ptr, type, member) container_of(ptr, type, member)

#define RB_EMPTY_ROOT(root) (!(root)->rb_node)
Expand Down
Loading