src/dpdk/lib/librte_bbdev/rte_bbdev.c
static struct rte_bbdev_data *
find_bbdev_data(const char *name)
{
	uint16_t data_id;

	for (data_id = 0; data_id < RTE_BBDEV_MAX_DEVS; ++data_id) {
		if (strlen(rte_bbdev_data[data_id].name) == 0) {
			memset(&rte_bbdev_data[data_id], 0,
					sizeof(struct rte_bbdev_data));
			return &rte_bbdev_data[data_id];
		} else if (strncmp(rte_bbdev_data[data_id].name, name,
				RTE_BBDEV_NAME_MAX_LEN) == 0)
			return &rte_bbdev_data[data_id];
	}

	return NULL;
}
/*
 * Find data alocated for the device or if not found return first unused bbdev
 * data. If all structures are in use and none is used by the device return
 * NULL.
 */
Find data alocated for the device or if not found return first unused bbdev
data. If all structures are in use and none is used by the device return
NULL.
Find data alocated for the device or if not found return first unused bbdev data . If all structures are in use and none is used by the device return NULL .
static struct rte_bbdev_data *
find_bbdev_data(const char *name)
{
	uint16_t data_id;
	for (data_id = 0; data_id < RTE_BBDEV_MAX_DEVS; ++data_id) {
		if (strlen(rte_bbdev_data[data_id].name) == 0) {
			memset(&rte_bbdev_data[data_id], 0,
					sizeof(struct rte_bbdev_data));
			return &rte_bbdev_data[data_id];
		} else if (strncmp(rte_bbdev_data[data_id].name, name,
				RTE_BBDEV_NAME_MAX_LEN) == 0)
			return &rte_bbdev_data[data_id];
	}
	return NULL;
}
static struct rte_bbdev_data * find_bbdev_data ( const char * name ) { uint16_t data_id ; for ( data_id = 0 ; data_id < RTE_BBDEV_MAX_DEVS ; ++ data_id ) { if ( strlen ( rte_bbdev_data [ data_id ] . name ) == 0 ) { memset ( & rte_bbdev_data [ data_id ] , 0 , sizeof ( struct rte_bbdev_data ) ) ; return & rte_bbdev_data [ data_id ] ; } else if ( strncmp ( rte_bbdev_data [ data_id ] . name , name , RTE_BBDEV_NAME_MAX_LEN ) == 0 ) return & rte_bbdev_data [ data_id ] ; } return NULL ; }
Find data alocated for the device or if not found return first unused bbdev
 data.
Find data alocated for the device or if not found return first unused bbdev data .