MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dma_check_name

Function dma_check_name

dpdk/lib/dmadev/rte_dmadev.c:69–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69static int
70dma_check_name(const char *name)
71{
72 size_t name_len;
73
74 if (name == NULL) {
75 RTE_DMA_LOG(ERR, "Name can't be NULL");
76 return -EINVAL;
77 }
78
79 name_len = strnlen(name, RTE_DEV_NAME_MAX_LEN);
80 if (name_len == 0) {
81 RTE_DMA_LOG(ERR, "Zero length DMA device name");
82 return -EINVAL;
83 }
84 if (name_len >= RTE_DEV_NAME_MAX_LEN) {
85 RTE_DMA_LOG(ERR, "DMA device name is too long");
86 return -EINVAL;
87 }
88
89 return 0;
90}
91
92static int16_t
93dma_find_free_id(void)

Callers 3

rte_dma_pmd_allocateFunction · 0.85
rte_dma_pmd_releaseFunction · 0.85

Calls 1

strnlenFunction · 0.85

Tested by

no test coverage detected