Solve those checkpatch warnings:
WARNING: braces {} are not necessary for single statement blocks
+ if (clock_gettime(clk_id, &ts) == 0 && !strcmp(ev.error_type, "Corrected")) {
+ ras_record_row_error(ev.driver_detail, ev.error_count, ts.tv_sec, ev.address);
+ }
total: 0 errors, 1 warnings, 0 checks, 304 lines checked
WARNING: braces {} are not necessary for single statement blocks
+ if (!matched) {
+ log(TERM, LOG_INFO, "Improper %s, set to default off\n", env);
+ }
WARNING: braces {} are not necessary for any arm of this statement
+ if (rr1->type == GHES) {
[...]
+ } else {
[...]
WARNING: braces {} are not necessary for single statement blocks
+ for (int i = 0; i < ROW_LOCATION_FIELDS_NUM; i++) {
+ dst->location_fields[i] = src->location_fields[i];
+ }
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
// even if the error_count is reported 0.
if (ev.error_count == 0)
ev.error_count = 1;
- if (clock_gettime(clk_id, &ts) == 0 && !strcmp(ev.error_type, "Corrected")) {
- ras_record_row_error(ev.driver_detail, ev.error_count, ts.tv_sec, ev.address);
- }
+ if (clock_gettime(clk_id, &ts) == 0 && !strcmp(ev.error_type, "Corrected"))
+ ras_record_row_error(ev.driver_detail, ev.error_count,
+ ts.tv_sec, ev.address);
#endif
#ifdef HAVE_ABRT_REPORT
}
}
- if (!matched) {
+ if (!matched)
log(TERM, LOG_INFO, "Improper %s, set to default off\n", env);
- }
if (row_offline_action > OFFLINE_ACCOUNT && access(kernel_offline[row_offline_action], W_OK)) {
log(TERM, LOG_INFO, "Kernel does not support row offline interface\n");
int field_num = 0;
- if (rr1->type == GHES) {
+ if (rr1->type == GHES)
field_num = APEI_FIELD_NUM_CONST;
- } else {
+ else
field_num = DSM_FIELD_NUM_CONST;
- }
+
for (int idx = 0; idx < field_num; idx++) {
if (rr1->location_fields[idx] != rr2->location_fields[idx])
return false;
if (!dst || !src)
return;
- for (int i = 0; i < ROW_LOCATION_FIELDS_NUM; i++) {
+ for (int i = 0; i < ROW_LOCATION_FIELDS_NUM; i++)
dst->location_fields[i] = src->location_fields[i];
- }
}
static int parse_value(const char *str, const char *anchor_str, int value_base, int *value)