-/*-
- * SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2014 Intel Corporation
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017 Intel Corporation
*/
#include "opdl_evdev.h"
uint32_t index = (i * max_num_port_xstat) + j;
/* Name */
- sprintf(device->port_xstat[index].stat.name,
- "port_%02u_%s",
- i,
- port_xstat_str[j]);
+ snprintf(device->port_xstat[index].stat.name,
+ sizeof(device->port_xstat[index].stat.name),
+ "port_%02u_%s", i, port_xstat_str[j]);
/* ID */
device->port_xstat[index].id = index;
uint32_t port_idx = queue_port_id * max_num_port_xstat;
- for (uint32_t j = 0; j < max_num_port_xstat; j++) {
+ uint32_t j;
+ for (j = 0; j < max_num_port_xstat; j++) {
strcpy(xstats_names[j].name,
device->port_xstat[j + port_idx].stat.name);
uint32_t p_start = queue_port_id * max_num_port_xstat;
uint32_t p_finish = p_start + max_num_port_xstat;
- for (uint32_t i = 0; i < n; i++) {
+ uint32_t i;
+ for (i = 0; i < n; i++) {
if (ids[i] < p_start || ids[i] >= p_finish)
return -EINVAL;
uint32_t max_index = device->max_port_nb * max_num_port_xstat;
- for (uint32_t i = 0; i < max_index; i++) {
+ uint32_t i;
+ for (i = 0; i < max_index; i++) {
if (strncmp(name,
device->port_xstat[i].stat.name,