Skip to content

Commit

Permalink
xfpga: fix static code scanner issues for metrics (#1122)
Browse files Browse the repository at this point in the history
  • Loading branch information
anandaravuri authored Jan 28, 2019
1 parent 803b28d commit 7fb37e4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
5 changes: 2 additions & 3 deletions libopae/plugins/xfpga/metrics/afu_metrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ fpga_result get_afu_metric_value(fpga_handle handle,
result = xfpga_fpgaReadMMIO64(handle, 0, _fpga_enum_metric->mmio_offset, &metric_csr.csr);

fpga_metric->value.ivalue = metric_csr.value;
result = FPGA_OK;

}

Expand Down Expand Up @@ -204,8 +203,8 @@ fpga_result add_afu_metrics_vector(fpga_metric_vector *vector,

*metric_id = *metric_id + 1;

add_metric_vector(vector, *metric_id, qualifier_name, group_name, "",
metric_name, "", metric_units, FPGA_METRIC_DATATYPE_INT, FPGA_METRIC_TYPE_AFU, FPGA_HW_MCP, metric_offset);
result = add_metric_vector(vector, *metric_id, qualifier_name, group_name, "",
metric_name, "", metric_units, FPGA_METRIC_DATATYPE_INT, FPGA_METRIC_TYPE_AFU, FPGA_HW_MCP, metric_offset);

return result;
}
Expand Down
4 changes: 0 additions & 4 deletions libopae/plugins/xfpga/metrics/metrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,6 @@ fpga_result __FPGA_API__ xfpga_fpgaGetMetricsByIndex(fpga_handle handle,
result = FPGA_OK;
}

} else {
result = FPGA_INVALID_PARAM;
}

out_unlock:
Expand Down Expand Up @@ -408,8 +406,6 @@ fpga_result __FPGA_API__ xfpga_fpgaGetMetricsByName(fpga_handle handle,
} else {
result = FPGA_OK;
}
} else {
result = FPGA_INVALID_PARAM;
}

out_unlock:
Expand Down
2 changes: 1 addition & 1 deletion libopae/plugins/xfpga/metrics/metrics_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ fpga_result get_bmc_metrics_values(fpga_handle handle,
snprintf_s_s(_handle->_bmc_metric_cache_value[x].metric_name, sizeof(_handle->_bmc_metric_cache_value[x].metric_name), "%s", details.name);
_handle->_bmc_metric_cache_value[x].fpga_metric.value.dvalue = tmp;

strcasecmp_s(details.name, sizeof(details.name), _fpga_enum_metric->metric_name, &metric_indicator);
strcasecmp_s(details.name, strnlen_s(details.name, SYSFS_PATH_MAX), _fpga_enum_metric->metric_name, &metric_indicator);
if (metric_indicator == 0) {
fpga_metric->value.dvalue = tmp;
}
Expand Down

0 comments on commit 7fb37e4

Please sign in to comment.